X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 604DE52B05 for ; Tue, 9 Aug 2005 10:59:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38209-06 for ; Tue, 9 Aug 2005 13:58:59 +0000 (GMT) Received: from wukifi.ugyvitelszolgaltato.hu (adsl215141.vnet.hu [62.77.215.141]) by svr1.postgresql.org (Postfix) with SMTP id E820C52A94 for ; Tue, 9 Aug 2005 10:58:57 -0300 (ADT) Received: (qmail 3333 invoked from network); 9 Aug 2005 13:04:44 -0000 Received: from unknown (HELO daq) (193.80.82.4) by 193.80.82.16 with SMTP; 9 Aug 2005 13:04:44 -0000 Date: Tue, 9 Aug 2005 15:58:57 +0200 From: daq X-Mailer: The Bat! (v1.53d) Business Reply-To: daq16 X-Priority: 3 (Normal) Message-ID: <1022859781.20050809155857@ugyvitelszolgaltato.hu> To: Pgsql-sql@postgresql.org Subject: Re: [NOVICE] Suspend Referential Integrity? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.901 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, RCVD_BY_IP, RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL X-Spam-Level: * X-Archive-Number: 200508/40 X-Sequence-Number: 22268 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