Re: Disable and enable of table and column constraints

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Gould <mgould(at)intermodalsoftwaresolutions(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Disable and enable of table and column constraints
Date: 2009-09-09 05:55:38
Message-ID: 1252475738.15729.1.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2009-09-09 06:55:22 Re: CTE bug?
Previous Message Tatsuo Ishii 2009-09-09 03:44:34 Re: pgbench hard coded constants