Exclusion constraint with negated operator?

Поиск
Список
Период
Сортировка
От Torsten Förtsch
Тема Exclusion constraint with negated operator?
Дата
Msg-id CAKkG4_=4Wo43KfFNE1i_91p+xJnGry_WM8fngH8Tv=F5wBD=wA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Exclusion constraint with negated operator?
Список pgsql-general
Hi,

I wanted to create an exclusion constraint like

EXCLUDE (c1 WITH =, c2 with <>)

This gives an error:

operator <>(integer,integer) is not a member of operator family "integer_ops"

I can resolve that by using gist and the btree_gist extension.

My question is can I somehow express something like

EXCLUDE (c1 WITH =, c2 with NOT =)

It seems that's not possible at the moment. But is there any obstacle in principle or is it just not implemented?

We have a ton of overlap operators (geometric, ranges, arrays) but none for the opposite. Sometimes that's useful for exclusion constraints.

Thanks,
Torsten

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Reproducing incorrect order with order by in a subquery
Следующее
От: "Patrick O'Toole"
Дата:
Сообщение: Helping planner to chose sequential scan when it improves performance