Re: How to temporarily disable a table's FK constraints?

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to temporarily disable a table's FK constraints?
Date: 2007-11-05 18:08:12
Message-ID: 20071105180812.GG1955@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 05, 2007 at 01:52:54PM -0400, Kynn Jones wrote:
> BTW, I realize that I can just drop and reinstate constraints, but
> from the point of view of writing a Perl script to do all this, it
> would be much easier if I could just disable temporarily all the FK
> constraints on a table.

Do you really want to disable the foreign key constraint, or just defer
their checking till you commit the transaction? If you just want to
defer checking, then [1] may help.

Sam

[1] http://www.postgresql.org/docs/current/static/sql-set-constraints.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-11-05 18:25:02 Re: How to temporarily disable a table's FK constraints?
Previous Message David Fetter 2007-11-05 18:04:31 Re: Problems with PostgreSQL DBI-Link / DBD-ODBC