X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C38269FA1A8 for ; Tue, 13 Jun 2006 23:09:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 63305-10 for ; Tue, 13 Jun 2006 23:08:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 2744B9FA38F for ; Tue, 13 Jun 2006 23:08:58 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k5E28us5018817; Tue, 13 Jun 2006 22:08:57 -0400 (EDT) To: "Jim C. Nasby" cc: "renneyt@yahoo.com" , postgres Subject: Re: pg_dump/restore problem In-reply-to: <20060613230242.GO34196@pervasive.com> References: <448DD3C6.8050801@yahoo.com> <20060612205630.GF34196@pervasive.com> <448F1FFF.50600@yahoo.com> <20060613230242.GO34196@pervasive.com> Comments: In-reply-to "Jim C. Nasby" message dated "Tue, 13 Jun 2006 18:02:42 -0500" Date: Tue, 13 Jun 2006 22:08:56 -0400 Message-ID: <18816.1150250936@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/117 X-Sequence-Number: 22079 "Jim C. Nasby" 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