X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 590929FB493 for ; Fri, 1 Sep 2006 15:42:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 17698-01 for ; Fri, 1 Sep 2006 15:41:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B23BE9FB45F for ; Fri, 1 Sep 2006 13:02:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k81G24Ok005510; Fri, 1 Sep 2006 12:02:04 -0400 (EDT) To: =?ISO-8859-1?Q?Lu=EDs_Sousa?= cc: pgsql-admin Subject: Re: Problem using pg_restore with -a option In-reply-to: <44F84649.9050502@ualg.pt> References: <44F84649.9050502@ualg.pt> Comments: In-reply-to =?ISO-8859-1?Q?Lu=EDs_Sousa?= message dated "Fri, 01 Sep 2006 15:40:09 +0100" Date: Fri, 01 Sep 2006 12:02:04 -0400 Message-ID: <5509.1157126524@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.126 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/9 X-Sequence-Number: 22923 =?ISO-8859-1?Q?Lu=EDs_Sousa?= writes: > Using the schema below, doing a pg_dump -Fc, delete all data, and a > pg_restore -a, the sequence of inserting data isn't correct issuing an > error. Data-only restores make no attempt to avoid foreign-key constraint problems --- in general there is no solution, since you could have circular constraints. You could drop and re-add the FK constraints, or if you trust that the data is valid there's the --disable-triggers option to suppress FK constraint checking. regards, tom lane