Re: operator exclusion constraints

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: operator exclusion constraints
Date: 2009-11-02 18:28:09
Message-ID: 1257186489.13207.76.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2009-11-02 at 13:12 -0500, Tom Lane wrote:
> Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> > On Mon, 2009-11-02 at 08:25 +0000, Peter Eisentraut wrote:
> >> I think the word CHECK should be avoided completely in this syntax, to
> >> avoid confusion with CHECK constraints.
>
> > This is an easy change. I don't have a strong opinion, so the only thing
> > I can think to do is ask for a vote.
>
> > Do you have a specific alternative in mind? How about just "WITH"?
>
> I think we had that discussion already, and rejected using "WITH" by
> itself because it was so totally devoid of suggestion of what it was
> the system would do "with" the expression or operator.
>
> If we don't want to introduce a new reserved word it's difficult to
> find alternatives :-(. One thing that just came to mind is that we
> might be able to do something like
>
> EXCLUSION (expr CHECK NOT operator)
> or
> EXCLUSION (expr CONSTRAIN NOT operator)
>
> I like the "NOT" here because "CHECK NOT =" seems to convey pretty
> clearly what it is you are checking for. Because NOT is reserved and
> can't appear as a connective, I think that this approach might allow
> a non-reserved leading word, thus possibly the second variant would
> work without reserving CONSTRAIN. I have not tested whether bison
> agrees with me though ;-). In any case I think "CHECK NOT =" reads
> pretty well, and don't feel a strong urge to use some other word there.

Yep, like the NOT.

Other ideas
EXCLUSION (expr NOT operator)

CONSTRAINT (expr NOT operator ALL ROWS)

--
Simon Riggs www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2009-11-02 18:41:58 Re: Renaming conversion procs (was Re: Error on compile for Windows)
Previous Message Heikki Linnakangas 2009-11-02 18:28:01 Re: Architecture of walreceiver (Streaming Replication)