X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EAFAE329DF7 for ; Sun, 26 Sep 2004 12:26:21 +0100 (BST) 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 73812-05 for ; Sun, 26 Sep 2004 11:26:15 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 5D1F6329D3E for ; Sun, 26 Sep 2004 12:26:16 +0100 (BST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id i8QBQCb8054727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 26 Sep 2004 05:26:15 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id i8QBQCuf010216; Sun, 26 Sep 2004 05:26:12 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id i8QBQBAc010215; Sun, 26 Sep 2004 05:26:11 -0600 (MDT) (envelope-from mfuhr) Date: Sun, 26 Sep 2004 05:26:11 -0600 From: Michael Fuhr To: gauthier lawny Cc: pgsql-admin@postgresql.org Subject: Re: pg_dump trouble Message-ID: <20040926112611.GA10133@winnie.fuhr.org> References: <20040924123359.77475.qmail@web42007.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040924123359.77475.qmail@web42007.mail.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/242 X-Sequence-Number: 14945 On Fri, Sep 24, 2004 at 02:33:59PM +0200, gauthier lawny wrote: > > I got 2 tables like > create table mytable(idnop serial, other varchar, > primary key (idnop)); > create table reftable(idnop integer references > mytable, primary key (idnop)); > > pgsql create implicitly a sequence to handle the idnop serial. > I perfomed some insertions into the 2 tables, no problem. > Afterthat I run pg_dump with -D option (insert into > (colomn, ...) values (...); > The trouble is when it dumps the sequence. Instead of > dumping the current value (which is the last used for > an insertion into mytable) it dumps the value 1. What version of PostgreSQL are you using? I tested this with 7.4.5 and 8.0.0beta2 and in both cases pg_dump used pg_catalog.setval() to set the value of the sequence to the correct value. > Obviously when I restore the data and I try to perform > an other insertion into mytable it fails because of > the primary key violation. Can you provide complete example that shows how we can duplicate the problem? -- Michael Fuhr http://www.fuhr.org/~mfuhr/