Re: creating CHECK constraints as NOT VALID

From: Marko Tiikkaja <marko(dot)tiikkaja(at)2ndquadrant(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: creating CHECK constraints as NOT VALID
Date: 2011-06-13 23:00:34
Message-ID: 4DF69692.6090406@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2011-06-13 23:08:46 Re: creating CHECK constraints as NOT VALID
Previous Message Andrew Dunstan 2011-06-13 23:00:16 Re: Creating new remote branch in git?