From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nikhil Sontakke <nikkhils(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: how to create a non-inherited CHECK constraint in CREATE TABLE |
Date: | 2012-04-11 18:58:36 |
Message-ID: | 1334170646-sup-4394@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Excerpts from Andrew Dunstan's message of mié abr 11 15:51:51 -0300 2012:
>
> On 04/11/2012 02:45 PM, Tom Lane wrote:
> > Alvaro Herrera<alvherre(at)commandprompt(dot)com> writes:
> >> Excerpts from Nikhil Sontakke's message of mié abr 11 15:07:45 -0300 2012:
> >>> This patch removes the support for :
> >>>
> >>> ALTER TABLE ONLY constraint_rename_test ADD CONSTRAINT con2 CHECK (b> 0);
> >>>
> >>> and uses
> >>>
> >>> ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK ONLY (b> 0);
> >>>
> >>> I know it's a bit late in the commitfest, but if this patch makes this
> >>> feature more "complete", maybe we should consider...
> >> Personally I don't think we should consider this for 9.2.
> > Well, if we're going to regret having offered the other syntax, now
> > would be the time to figure that out, before we ship it not after.
> > I would go so far as to say that if we don't accept this for 9.2
> > we probably shouldn't accept it at all, because two different ways
> > to spell the same thing isn't nice.
> >
> > I don't really care for the idea that the ONLY goes in a different place
> > for this operation than for every other kind of ALTER TABLE, but it does
> > make sense if you subscribe to the quoted theory that ONLY is a property
> > of the constraint and not the ALTER command as such.
>
> I think I rather dislike it. ONLY should be followed by the name of the
> parent table whose children it causes us to exclude, IMNSHO. Moving it
> elsewhere doesn't seem to me to be a blow for clarity at all.
If that's the only objection, maybe we could use a different keyword
then, perhaps NOINHERIT:
ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK NOINHERIT (b> 0);
--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-04-11 19:06:17 | Re: how to create a non-inherited CHECK constraint in CREATE TABLE |
Previous Message | Andrew Dunstan | 2012-04-11 18:51:51 | Re: how to create a non-inherited CHECK constraint in CREATE TABLE |