Re: Suspend Referential Integrity? - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: Suspend Referential Integrity?
Date
Msg-id 20050809133106.GA10109@winnie.fuhr.org
Whole thread Raw
In response to Suspend Referential Integrity?  (Jim Jarrett <jarrett@rpa.net>)
List pgsql-novice
On Tue, Aug 09, 2005 at 09:14:50AM -0400, Jim Jarrett wrote:
> Is there a way to temporarily suspend RI checking so I can load the data and
> then fix it later?

You could drop and then re-create the foreign key constraints with
ALTER TABLE, or you could create the constraints as DEFERRABLE and
defer them during the load with SET CONSTRAINTS (or make them
INITIALLY DEFERRED).

http://www.postgresql.org/docs/8.0/static/sql-altertable.html
http://www.postgresql.org/docs/8.0/static/sql-createtable.html
http://www.postgresql.org/docs/8.0/static/sql-set-constraints.html

--
Michael Fuhr

pgsql-novice by date:

Previous
From: Jim Jarrett
Date:
Subject: Suspend Referential Integrity?
Next
From: Sean Davis
Date:
Subject: Re: Suspend Referential Integrity?