Re: Disable and enable of table and column constraints - Mailing list pgsql-hackers

From Christopher Browne
Subject Re: Disable and enable of table and column constraints
Date
Msg-id 87skewcgtm.fsf@dba2.int.libertyrms.com
Whole thread Raw
In response to Disable and enable of table and column constraints  (Michael Gould <mgould@intermodalsoftwaresolutions.net>)
Responses Re: Disable and enable of table and column constraints
List pgsql-hackers
peter_e@gmx.net (Peter Eisentraut) writes:
> On Tue, 2009-09-08 at 16:07 -0400, Alvaro Herrera wrote:
>> Tom Lane wrote:
>> > Michael Gould <mgould@intermodalsoftwaresolutions.net> writes:
>> > > It would be nice if we could enable and disable column and table
>> > > constraints.  I believe that you can do this in Oracle but this is very
>> > > handy for testing stored procedures and other external processes.
>> > 
>> > Drop the constraint and re-add it later...
>> 
>> That's not very useful when adding it later means grabbing an exclusive
>> lock on the table for the whole duration of the full table scan required
>> to check the table.
>
> It's also useful to define foreign keys for documentation purposes but
> not enforce them for some reason.

With the ALTER TABLE DISABLE TRIGGER functionality added in 8.3, we
already have the ability to do this with foreign key constraints.

That suggests a place for syntax to come from, I'd expect.
-- 
let name="cbbrowne" and tld="ca.afilias.info" in name ^ "@" ^ tld;;
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: RfD: more powerful "any" types
Next
From: Andrew Dunstan
Date:
Subject: Re: Ragged CSV import