Re: pg_dump/restore problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Jim C. Nasby" <jnasby@xxxxxxxxxxxxx> writes:
> On Tue, Jun 13, 2006 at 04:28:47PM -0400, renneyt@xxxxxxxxx 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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux