pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: daq <daq@ugyvitelszolgaltato.hu>
To: Pgsql-sql@postgresql.org
Subject: Re: [NOVICE] Suspend Referential Integrity?
Date: Tue, 9 Aug 2005 15:58:57 +0200
Message-ID: <1022859781.20050809155857@ugyvitelszolgaltato.hu> (raw)

JJ> I'm trying to port a database from Oracle to PostgreSQL.  I used a perl script,
JJ> ora2pg to extract the info from Oracle.  

JJ> The table data was extracted in alphabetical order.  When I attempt to load it,
JJ> I get referential integrity violations (eg. I attempt to load CUSTOMER, but
JJ> CUSTOMOER depends on the SOURCE table, which hasn't been loaded yet).

JJ> Is there a way to temporarily suspend RI checking so I can load the data and
JJ> then fix it later?

JJ> =================================================================
JJ> | Jim Jarrett,Madison, WI       94 Passat GLX                   |
JJ> | mailto:jarrett@rpa.net         81 Rabbit Convertible 16v      |
JJ> |                                                               |
JJ> |    Any problem can be solved with the proper application of   |
JJ> |   Force, Heat, Chemicals, or Money.                           |
JJ> ================================================================

JJ> ---------------------------(end of broadcast)---------------------------
JJ> TIP 6: explain analyze is your friend

You can switch off all triggers on a table.

update pg_class set reltriggers=0 where relname='your_table_name';

To switch back:

update pg_class set reltriggers=(select count(*) from pg_triggers
where pg_class.oid=tgrelid) where relname='your_table_name';

DAQ




Message-ID: <1022859781.20050809155857@ugyvitelszolgaltato.hu>
Permalink:  ../1022859781.20050809155857@ugyvitelszolgaltato.hu/
Also on:    postgresql.org/message-id/1022859781.20050809155857@ugyvitelszolgaltato.hu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: daq@ugyvitelszolgaltato.hu
  Subject: Re: [NOVICE] Suspend Referential Integrity?
  In-Reply-To: <1022859781.20050809155857@ugyvitelszolgaltato.hu>
  References: <1022859781.20050809155857@ugyvitelszolgaltato.hu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox