From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: renneyt@yahoo.com <renneyt@yahoo.com>
Cc: postgres <pgsql-admin@postgresql.org>
Subject: Re: pg_dump/restore problem
Date: Tue, 13 Jun 2006 22:08:56 -0400
Message-ID: <18816.1150250936@sss.pgh.pa.us> (raw)
In-Reply-To: <20060613230242.GO34196@pervasive.com>
References: <448DD3C6.8050801@yahoo.com>
<20060612205630.GF34196@pervasive.com>
<448F1FFF.50600@yahoo.com>
<20060613230242.GO34196@pervasive.com>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, jnasby@pervasive.com, renneyt@yahoo.com
Subject: Re: pg_dump/restore problem
In-Reply-To: <18816.1150250936@sss.pgh.pa.us>
References: <448DD3C6.8050801@yahoo.com> <20060612205630.GF34196@pervasive.com> <448F1FFF.50600@yahoo.com> <20060613230242.GO34196@pervasive.com> <18816.1150250936@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox