Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID

From: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID
Date: 2011-11-26 04:09:09
Message-ID: CAJKUy5ifZYNZHgFwTDgzgvGLtRQS7Yxh=r2H1UvOT7HJfdk23Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Nov 25, 2011 at 4:28 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
>
> Excerpts from Dean Rasheed's message of vie nov 25 13:45:34 -0300 2011:
>
>> Looking back at Thom's original example, it seems odd to allow this
>> syntax at all:
>>
>> CREATE TABLE a (
>>    num integer,
>>    CONSTRAINT meow CHECK ((num < 20)) NOT VALID
>> );
>>
>> It's not documented, but is currently allowed. However, since all data
>> subsequently added to the table is checked against the constraint, the
>> constraint is guaranteed to be valid, so there seems to be no point in
>> allowing it to be declared NOT VALID.
>
> Hah ... interesting.  Not sure it's worth fussing about this.  If the
> user shoots himself in the foot by declaring an unvalidated constraint,
> which is not even documented, are we really at fault?
>

i can't find anything about this in the standard, so i guess even if
the standard allows us to turn checks off. ours is not standard syntax
so, IMHO, it should be only in ALTER TABLE.

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-11-26 07:13:09 Re: pgsql: Modify pg_dump to use error-free memory allocation macros. This
Previous Message Bruce Momjian 2011-11-26 00:08:43 pgsql: Remove ENABLE_SAME_CATVERSION_UPGRADES as unnecessary.

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-11-26 07:11:13 Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)
Previous Message Robert Haas 2011-11-26 01:10:51 Re: Displaying accumulated autovacuum cost