Re: Disable and enable of table and column constraints

From: Christopher Browne <cbbrowne(at)ca(dot)afilias(dot)info>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Disable and enable of table and column constraints
Date: 2009-09-09 14:51:01
Message-ID: 87skewcgtm.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

peter_e(at)gmx(dot)net (Peter Eisentraut) writes:
> On Tue, 2009-09-08 at 16:07 -0400, Alvaro Herrera wrote:
>> Tom Lane wrote:
>> > Michael Gould <mgould(at)intermodalsoftwaresolutions(dot)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"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rafael Martinez 2009-09-09 15:13:15 Re: More robust pg_hba.conf parsing/error logging
Previous Message Alvaro Herrera 2009-09-09 14:33:16 Re: More robust pg_hba.conf parsing/error logging