Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-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

pgsql-hackers by date

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

pgsql-committers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group