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 E8E9E9FB4BA for ; Fri, 1 Sep 2006 15:20:13 -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 14367-03-7 for ; Fri, 1 Sep 2006 15:19:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id EE3979FB561 for ; Fri, 1 Sep 2006 12:43:23 -0300 (ADT) Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl [201.221.200.187]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k81FhJtD000730; Fri, 1 Sep 2006 08:43:20 -0700 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 327F5C2DC58; Fri, 1 Sep 2006 11:43:04 -0400 (CLT) Date: Fri, 1 Sep 2006 11:43:04 -0400 From: Alvaro Herrera To: =?iso-8859-1?Q?Lu=EDs?= Sousa Cc: pgsql-admin Subject: Re: Problem using pg_restore with -a option Message-ID: <20060901154304.GF3755@alvh.no-ip.org> Mail-Followup-To: =?iso-8859-1?Q?Lu=EDs?= Sousa , pgsql-admin References: <44F84649.9050502@ualg.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <44F84649.9050502@ualg.pt> User-Agent: Mutt/1.5.12-2006-07-14 X-Virus-Scanned: ClamAV version 0.88.3, clamav-milter version 0.88.3 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Fri, 01 Sep 2006 08:43:25 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.286 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/8 X-Sequence-Number: 22922 Luís Sousa wrote: > Hi all, > > I'm using PostgreSQL 7.4.7-6sarge2 (debian) > > 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. > Could this be a bug? Not a bug -- rather a known deficiency. pg_dump 8.0 and beyond knows how to sort stuff so that these problems do not occur, but 7.4 doesn't. The typical workaround was to use pg_restore -l/-L to generate the list of objects to restore and sort them appropiately, then do the actual restore. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.