Re: exclusion constraint question

Поиск
Список
Период
Сортировка
От Rhys A.D. Stewart
Тема Re: exclusion constraint question
Дата
Msg-id CACg0vTkWs2huWDyp6EJHcsAcdcDSyo6CRMD36z4sr7S7ZY-8Qg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: exclusion constraint question  (Achilleas Mantzios - cloud <a.mantzios@cloud.gatewaynet.com>)
Ответы Re: exclusion constraint question
Список pgsql-general
Greetings,

> I think I got it :
>
> ALTER TABLE shelves ADD CONSTRAINT shelves_excl EXCLUDE USING gist(
array_remove((ARRAY[l_mug_id,c_mug_id,r_mug_id]::int[]),NULL)WITH && );
 
>
> but the caveat is I had to cast to 32-bit int array. Haven't found any opclass for int8  (bigint) in intarray
extension.

I tried this and got the opclass error for the int8 and (since
postgres is so wonderfully extensible) considered trying to write the
oppclass for bigint. But ultimately writing the trigger as suggested
by Laurenz is much easier. So that is the route I went,

Thanks all for your input.

Rhys
Peace & Love | Live Long & Prosper



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