I'm getting error while I use Exclude constraint using gist
ALTER TABLE tbl_product ADD EXCLUDE USING gist (base_id WITH =, lifetime WITH &&);
ERROR: data type uuid has no default operator class for access method "gist"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
Note:
base_id
datatype is uuid,
lifetime
datatype is period
I am using PostgreSQL 9.4. I have to use 9.4 only as I don't have any other option since I am unable to install temporal
extension in 9.5, 9.6 and 10 are gives an error.
You'll need the
btree_gist
extension for that:Unfortunately support for
uuid
was only added in v10.With v10, you should be able to use
in your exclusion constraint.
With 9.4, you could cast the column to a different type first: