Re: operator exclusion constraints [was: generalized index constraints]

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: pgsql-hackers@postgresql.org
Date: 2009-09-20T17:49:08Z
Lists: pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> I believe that syntax is possible by specifying the index access method,
> e.g.:

>   CONSTRAINT <name> EXCLUSION (a =, b &&) USING gist;

> versus:

>   CONSTRAINT <name> EXCLUSION (a =, b &&) INDEX <indexname>;

> And the former could build the index implicitly. I haven't written the
> code yet, but I don't see any major problems.

> So, should I eliminate the latter syntax and only support the former, or
> should I support both?

I'd vote for only supporting the former.

What worries me more about that syntax is the postfix-operator ambiguity
--- I think it'll be hard to expand it to expressions.  It might be
better to put the operator at the front; or maybe you need an extra
keyword in there.

			regards, tom lane