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 C06959FA3CD for ; Mon, 12 Jun 2006 17:56:43 -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 24069-04 for ; Mon, 12 Jun 2006 17:56:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 571679FA159 for ; Mon, 12 Jun 2006 17:56:34 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 4B67F56443; Mon, 12 Jun 2006 15:56:31 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Mon, 12 Jun 2006 15:56:30 -0500 Date: Mon, 12 Jun 2006 15:56:30 -0500 From: "Jim C. Nasby" To: "renneyt@yahoo.com" Cc: postgres Subject: Re: pg_dump/restore problem Message-ID: <20060612205630.GF34196@pervasive.com> References: <448DD3C6.8050801@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <448DD3C6.8050801@yahoo.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060612:renneyt@yahoo.com::v1XPz2EYzZLngF7S:00000000000000000000 0000000000000000000000000RtH X-Hashcash: 1:20:060612:pgsql-admin@postgresql.org::SMPRnYzpZ8e9dZ27:00000000000 0000000000000000000000003aXl X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/111 X-Sequence-Number: 22073 On Mon, Jun 12, 2006 at 04:51:18PM -0400, renneyt@yahoo.com wrote: > I am trying to move some data from an 8.0.7 instance to a 7.4.8 > instance. I did a pg_dump and then did a pg_restore. > For the most part the data transferred through to the older instance but > I had problems with the sequence updates. > > SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('nw_foo', > 'foo_id'), 678, true); > ERROR: function pg_catalog.pg_get_serial_sequence("unknown", "unknown") > does not exist > HINT: No function matches the given name and argument types. You may > need to add explicit type casts. > > I am looking for a an alternative to manually issuing alter sequence > commands. From http://www.postgresql.org/docs/8.1/interactive/release-8-0.html: # Add pg_get_serial_sequence() to return a SERIAL column's sequence name (Christopher) This allows automated scripts to reliably find the SERIAL sequence name. If you use a 7.x copy of pg_dump it might work, though there could be catalog changes that make that a problem. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461