Re: how to temporally disable foreign key constraint check - Mailing list pgsql-sql

From Craig Ringer
Subject Re: how to temporally disable foreign key constraint check
Date
Msg-id 4EA2057F.3000002@ringerc.id.au
Whole thread Raw
In response to how to temporally disable foreign key constraint check  (Emi Lu <emilu@encs.concordia.ca>)
List pgsql-sql
On 10/21/2011 09:36 PM, Emi Lu wrote:
> Good morning,
>
>
> Is there a way to temporally disabled foreign key constraints something
> like
>
> SET FOREIGN_KEY_CHECKS=0
>
> When population is done, will set FOREIGN_KEY_CHECKS=1

If you really, really want to do this you can do it by disabling the 
triggers that enforce the checks on particular tables. This must be done 
table-by-table, there's no global way to do it.

Use ALTER TABLE ... DISABLE TRIGGER to do it. See:

http://www.postgresql.org/docs/current/static/sql-altertable.html

--
Craig Ringer



pgsql-sql by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: how to temporally disable foreign key constraint check
Next
From: Linos
Date:
Subject: advice on how to store variable attributes