Re: creating CHECK constraints as NOT VALID

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: creating CHECK constraints as NOT VALID
Date: 2011-06-13 22:11:54
Message-ID: 4DF68B2A.80705@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro, Dean,

>> I think that you also need to update the constraint exclusion code
>> > (get_relation_constraints() or nearby), otherwise the planner might
>> > exclude a relation on the basis of a CHECK constraint that is not
>> > currently VALID.
> Ouch, yeah, thanks for pointing that out. Fortunately the patch to fix
> this is quite simple. I don't have it handy right now but I'll post it
> soon.

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 ...).

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-06-13 22:38:46 Re: Creating new remote branch in git?
Previous Message Alvaro Herrera 2011-06-13 22:08:12 Re: creating CHECK constraints as NOT VALID