Re: pg_dump/restore problem

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: "renneyt(at)yahoo(dot)com" <renneyt(at)yahoo(dot)com>
Cc: postgres <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_dump/restore problem
Date: 2006-06-12 20:56:30
Message-ID: 20060612205630.GF34196@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Jun 12, 2006 at 04:51:18PM -0400, renneyt(at)yahoo(dot)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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message renneyt@yahoo.com 2006-06-13 04:55:25 PLPGSQL/EXCEPTION HANDLING
Previous Message Jeff Frost 2006-06-12 20:54:43 Re: pg_dumpall 8.1.4 large objects error