Re: operator exclusion constraints [was: generalized index constraints] - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: operator exclusion constraints [was: generalized index constraints]
Date
Msg-id 1253719318.5640.17.camel@jdavis
Whole thread Raw
In response to Re: operator exclusion constraints [was: generalized index constraints]  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: operator exclusion constraints [was: generalized index constraints]
List pgsql-hackers
On Wed, 2009-09-23 at 15:10 +0300, Peter Eisentraut wrote:
> Using CHECK as part of the syntax of an EXCLUSION constraint will surely
> confuse the whole thing with CHECK constraints.
> 
> USING OPERATOR is available, I think.

USING won't work because one of the ways to specify the opclass in an
index_elem is something like:
 CREATE INDEX foo_idx on foo (i USING int4_ops);

which appears to be undocumented, and it's not obvious to me why that is
useful. The normal way is just:
 CREATE INDEX foo_idx on foo (i int4_ops);

Because I am allowing any index_elem for exclusion constraints, that
conflicts with the word USING.

We can either eliminate the USING variant from opt_class (unless it's
necessary for some reason or I missed it in the documentation), or we
can use another word (e.g. WITH or WITH OPERATOR) if you don't like
CHECK.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Christian Ullrich
Date:
Subject: Re: Getting the red out (of the buildfarm)
Next
From: Tom Lane
Date:
Subject: Re: Anonymous code blocks