Re: operator exclusion constraints - Mailing list pgsql-hackers

From Robert Haas
Subject Re: operator exclusion constraints
Date
Msg-id 603c8f070911031433v4150619aob540276cad9c3b32@mail.gmail.com
Whole thread Raw
In response to Re: operator exclusion constraints  (Jeff Davis <pgsql@j-davis.com>)
List 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 by date:

Previous
From: Simon Riggs
Date:
Subject: Re: EOL for 7.4?
Next
From: Greg Stark
Date:
Subject: Re: EOL for 7.4?