Re: creating CHECK constraints as NOT VALID

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: creating CHECK constraints as NOT VALID
Date: 2011-06-15 07:33:57
Message-ID: BANLkTinJ6xjToP2NRECAW-91X+y+QEBTsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 June 2011 07:09, Jaime Casanova <jaime(at)2ndquadrant(dot)com> wrote:
> On Tue, Jun 14, 2011 at 4:14 PM, Alvaro Herrera
> <alvherre(at)commandprompt(dot)com> wrote:
>> Excerpts from Alvaro Herrera's message of lun jun 13 18:08:12 -0400 2011:
>>> Excerpts from Dean Rasheed's message of sáb jun 11 09:32:15 -0400 2011:
>>
>>> > 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.
>>
>> Here's the complete patch.
>>
>
> psql \h says (among other things) for ALTER TABLE
> """
>   ADD table_constraint
>   ADD table_constraint_using_index
>   ADD table_constraint [ NOT VALID ]
> """
>
> ADD table_constraint appears twice and isn't true that all
> table_constraint accept the NOT VALID syntax... maybe we can accpet
> the syntax and send an unimplemented feature message for the other
> table_constraints?
>

Yeah, I was just about to make the same observation about the 9.1beta
docs. The 3rd line makes the 1st one redundant.

Regards,
Dean

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-06-15 07:34:34 Re: procpid?
Previous Message Leonardo Francalanci 2011-06-15 07:31:21 Re: use less space in xl_xact_commit patch