Re: creating CHECK constraints as NOT VALID - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: creating CHECK constraints as NOT VALID
Date
Msg-id 4DF69692.6090406@2ndquadrant.com
Whole thread Raw
In response to Re: creating CHECK constraints as NOT VALID  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On 14/06/2011 01:11, Josh Berkus wrote:
> Hmmm. Is this the behavior we want with NOT VALID constraints though?
>
> I know that if I'm pouring 100m rows into a new partition as part of a
> repartitioning scheme, I don't want to *ever* check them if I know
> they're correct because of how I created the table (CREATE TABLE AS ...).

I can see why you would want that, but I'd say that's a separate feature 
you need to explicitly request when creating the constraint.  Consider 
what happens in the "old data is garbage, but I want the new data to be 
validated" use case if we allow constraint exclusion on NOT VALID 
constraints.


-- 
Marko Tiikkaja                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: creating CHECK constraints as NOT VALID
Next
From: Bruce Momjian
Date:
Subject: Re: pg_trgm: unicode string not working