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

Re: creating CHECK constraints as NOT VALID

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>, "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: creating CHECK constraints as NOT VALID
Date: 2011-05-31 16:35:01
Message-ID: 4DE4D265020000250003DF04@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
 
> This patch allows you to initially declare a CHECK constraint as
> NOT VALID, similar to what we already allow for foreign keys. 
> That is, you create the constraint without scanning the table and
< after it is committed, it is enforced for new rows; later, all
> rows are checked by running ALTER TABLE VALIDATE CONSTRAINT, which
> doesn't need AccessExclusive thus allowing for better concurrency.
 
I think it's a valuable feature, not just in terms of timing and
concurrency, but in terms of someone starting with less-than-perfect
data who wants to prevent further degradation while cleaning up the
existing problems.  This feature is present in other databases I've
used.
 
-Kevin

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2011-05-31 16:36:26
Subject: Re: creating CHECK constraints as NOT VALID
Previous:From: Joshua D. DrakeDate: 2011-05-31 16:32:43
Subject: Re: Getting a bug tracker for the Postgres project

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