Re: pg_dump/restore problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: "renneyt(at)yahoo(dot)com" <renneyt(at)yahoo(dot)com>, postgres <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_dump/restore problem
Date: 2006-06-14 02:08:56
Message-ID: 18816.1150250936@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> On Tue, Jun 13, 2006 at 04:28:47PM -0400, renneyt(at)yahoo(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jaime Casanova 2006-06-14 02:49:44 Re: PLPGSQL/EXCEPTION HANDLING
Previous Message Jim C. Nasby 2006-06-13 23:02:42 Re: pg_dump/restore problem