Exclusion Constraints on Arrays?

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Exclusion Constraints on Arrays?
Дата
Msg-id C7E9B9D1-40B5-4E34-958F-C2E58517AEB2@justatheory.com
обсуждение исходный текст
Ответы Re: Exclusion Constraints on Arrays?  (Robert Haas <robertmhaas@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Credit in the release notes WAS: Draft release notes complete
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Draft release notes complete