Re: pg_dump/restore problem - Mailing list pgsql-admin

From Tom Lane
Subject Re: pg_dump/restore problem
Date
Msg-id 18816.1150250936@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump/restore problem  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-admin
"Jim C. Nasby" <jnasby@pervasive.com> writes:
> On Tue, Jun 13, 2006 at 04:28:47PM -0400, renneyt@yahoo.com wrote:
>> Does  pg_get_serial_sequence()  exist as plpgsql code? Where may I find
>> it? I would like to retrofit it into a 7.4.8 PG database.

> No, but it shouldn't be terribly hard to do it in plpgsql; you just need
> to build the right sequence name (assuming you haven't been messing with
> the sequence names).

You could actually do it 100% correctly in plpgsql; it's really just a
query into pg_depend to find the sequence dependent on the column.

But if your need is just to restore one specific dump, I'd be inclined
to edit the dump file.  Most of the time, pg_get_serial_sequence('foo',
'bar') just results in 'foo_bar_seq'.

            regards, tom lane

pgsql-admin by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: pg_dump/restore problem
Next
From: "Jaime Casanova"
Date:
Subject: Re: PLPGSQL/EXCEPTION HANDLING