Re: operator exclusion constraints

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: operator exclusion constraints
Дата
Msg-id 603c8f070911031433v4150619aob540276cad9c3b32@mail.gmail.com
обсуждение исходный текст
Ответ на Re: operator exclusion constraints  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On Tue, Nov 3, 2009 at 5:05 PM, Jeff Davis <pgsql@j-davis.com> wrote:
> We already have some reasonable agreement around EXCLUSION ... CHECK
> WITH. We should stick with the current syntax unless there's a good
> consensus around some other specific proposal.

Yeah.  I don't like the inflexibility of the current syntax, but
that's mostly because I wish the feature itself could be made more
general.  It would be nice to be able to write constraints of the
form:

forall <vars> : <expression>

For example, a uniqueness constraint on a column c is: forall x,y : x.c != y.c
And a does-not overlap constraint might look like this: forall x,y :
NOT (x.c && y.c)

Note that an ordinary check constraint is a special case of this where
there is only one rowvar and it is implicit.

HOWEVER, this is probably a lot more work than what you've already
done, and what you've already done is really good, and we shouldn't
hesitate to commit on the grounds that it won't cure diabetes and
balance the budget.  I don't think there is any really beautiful
syntax for the feature as it stands, but considering how useful it is
I am not inclined to stand on ceremony...

...Robert


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: EOL for 7.4?
Следующее
От: Greg Stark
Дата:
Сообщение: Re: EOL for 7.4?