Hackers,
I need a constraint that ensures that a text[] column has only unique values -- that is, that there is no overlap of
valuesbetween rows. I thought this was a made-to-order for an exclusion constraint. So I tried it:
david=# create table tags (names text[] primary key, exclude using gist (names WITH &&));NOTICE: CREATE TABLE /
PRIMARYKEY will create implicit index "tags_pkey" for table "tags"
ERROR: data type text[] 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.
Rats! It looks like there is only a gin operator family for arrays, not gist, and exclusion constraints support only
gistindexes, and I couldn't find an operator class, either. Have I missed something, in my (likely) ignorance? Or are
thereperhaps some types to consider modifying to support exclusion constraints?
Thanks,
David