Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID
Date
Msg-id 1322256419-sup-7794@alvh.no-ip.org
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID
List pgsql-hackers
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?

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID
Next
From: Jeff Janes
Date:
Subject: Re: Inserting heap tuples in bulk in COPY