Re: Exclusion constraints on overlapping text arrays?

Поиск
Список
Период
Сортировка
От Achilleas Mantzios
Тема Re: Exclusion constraints on overlapping text arrays?
Дата
Msg-id df6ca4ee-1408-2154-fdff-4ea3ab9c1256@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на Exclusion constraints on overlapping text arrays?  (Ken Tanzer <ken.tanzer@gmail.com>)
Ответы Re: Exclusion constraints on overlapping text arrays?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-general
On 30/8/19 3:42 π.μ., Ken Tanzer wrote:
Hi.  Using 9.6.14, I was setting up a table with this:

EXCLUDE using gist (EXCLUDE using gist (grant_number_codes with &&)

Where grant_numbers is a varchar[].  I get this error:

ERROR:  data type character varying[] 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.


I did some Googling, and it looks like you could do this for integer arrays with the intarray extension.  I didn't see anything I'd recognize as an equivalent for varchar (or text) arrays.  Is there any way to do this now?  And if not, is there much prospect of this being implemented at some point?

I found a couple of old threads about this.  Not sure if they are still relevant, but listed below.

Also, on a side note, I tried using grant_number_codes::text[] with &&, but that got a syntax error.  Does that mean casting isn't allowed at all in these constraints?
Maybe take a look at https://dba.stackexchange.com/questions/185174/error-data-type-text-has-no-default-operator-class-for-access-method-gist

Thanks in advance,
Ken

1) This 2014 thread asked about this:

array exclusion constraints

and pointed toward this 2013 discussion:

Todo item: Support amgettuple() in GIN



--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

В списке pgsql-general по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: literal vs dynamic partition constraint in plan execution
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Exclusion constraints on overlapping text arrays?