Exclusion Constraints on Arrays? - Mailing list pgsql-hackers

From David E. Wheeler
Subject Exclusion Constraints on Arrays?
Date
Msg-id C7E9B9D1-40B5-4E34-958F-C2E58517AEB2@justatheory.com
Whole thread Raw
Responses Re: Exclusion Constraints on Arrays?
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Credit in the release notes WAS: Draft release notes complete
Next
From: Robert Haas
Date:
Subject: Re: Draft release notes complete