Re: FK NOT VALID can't be deferrable? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: FK NOT VALID can't be deferrable?
Date
Msg-id 29433.1308153265@sss.pgh.pa.us
Whole thread Raw
In response to Re: FK NOT VALID can't be deferrable?  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: FK NOT VALID can't be deferrable?
Re: FK NOT VALID can't be deferrable?
List pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On 15 June 2011 07:56, Jaime Casanova <jaime@2ndquadrant.com> wrote:
>> Testing the CHECK NOT VALID patch i found $subject... is this intended?

> Aside from the ugliness of the code, we can't just add a
> ConstraintAttributeSpec to the second block, because that would
> enforce an order to these options.

> OTOH adding NOT VALID to ConstraintAttributeSpec is a bit invasive,
> since it's used in quite a few places, including CREATE TABLE, where
> NOT VALID is never allowed.

> Thoughts?

I think we need to do the second one, ie, add it to
ConstraintAttributeSpec and do what's necessary to filter later.
The reason we have a problem here is exactly that somebody took
shortcuts.

It'd probably be sufficient to have one or two places in
parse_utilcmds.c know which variants of Constraint actually support
NOT VALID, and throw an error for the rest.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: procpid?
Next
From: Alvaro Herrera
Date:
Subject: Re: procpid?