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 00A849FA13E for ; Tue, 13 Jun 2006 17:29:05 -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 25220-01 for ; Tue, 13 Jun 2006 17:28:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp109.plus.mail.re2.yahoo.com (smtp109.plus.mail.re2.yahoo.com [206.190.53.34]) by postgresql.org (Postfix) with SMTP id D5C029F9316 for ; Tue, 13 Jun 2006 17:28:50 -0300 (ADT) Received: (qmail 89779 invoked from network); 13 Jun 2006 20:28:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type; b=bkGwQRvayZnjK7S8q+0Sj2au9ba9tONDqLU89ZxUpHcCVYwMgKBbSH1rj11mM+5FgUArGiHU/1i/xMdkX1HKI2sXsKvl7p0pxzfTmfbWyu1qusiKPtRLVvTU/03ocaiWbBk0OWXWPMT3dTibN9PCM4PDiimtT2Fh3WqjYaeKx/c= ; Received: from unknown (HELO ?192.168.20.100?) (renneyt@68.81.191.20 with plain) by smtp109.plus.mail.re2.yahoo.com with SMTP; 13 Jun 2006 20:28:48 -0000 Message-ID: <448F1FFF.50600@yahoo.com> Date: Tue, 13 Jun 2006 16:28:47 -0400 From: "renneyt@yahoo.com" User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: "Jim C. Nasby" CC: postgres Subject: Re: pg_dump/restore problem References: <448DD3C6.8050801@yahoo.com> <20060612205630.GF34196@pervasive.com> In-Reply-To: <20060612205630.GF34196@pervasive.com> Content-Type: multipart/alternative; boundary="------------000708010503020204000004" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/115 X-Sequence-Number: 22077 This is a multi-part message in MIME format. --------------000708010503020204000004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jim C. Nasby wrote: > On Mon, Jun 12, 2006 at 04:51:18PM -0400, renneyt@yahoo.com wrote: > >> I am trying to move some data from an 8.0.7 instance to a 7.4.8 >> instance. I did a pg_dump and then did a pg_restore. >> For the most part the data transferred through to the older instance but >> I had problems with the sequence updates. >> >> SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('nw_foo', >> 'foo_id'), 678, true); >> ERROR: function pg_catalog.pg_get_serial_sequence("unknown", "unknown") >> does not exist >> HINT: No function matches the given name and argument types. You may >> need to add explicit type casts. >> >> I am looking for a an alternative to manually issuing alter sequence >> commands. >> > > >From http://www.postgresql.org/docs/8.1/interactive/release-8-0.html: > > # Add pg_get_serial_sequence() to return a SERIAL column's sequence name > (Christopher) > > 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. Thanks > This allows automated scripts to reliably find the SERIAL sequence name. > > If you use a 7.x copy of pg_dump it might work, though there could be > catalog changes that make that a problem. > --------------000708010503020204000004 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Jim C. Nasby wrote:
On Mon, Jun 12, 2006 at 04:51:18PM -0400, renneyt@yahoo.com wrote:
  
I am trying to move some data from an 8.0.7 instance to a 7.4.8 
instance. I did a pg_dump and then did a pg_restore.
For the most part the data transferred through to the older instance but 
I had problems with the sequence updates.

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('nw_foo', 
'foo_id'), 678, true);
ERROR:  function pg_catalog.pg_get_serial_sequence("unknown", "unknown") 
does not exist
HINT:  No function matches the given name and argument types. You may 
need to add explicit type casts.

I am looking for a an alternative to manually issuing alter sequence 
commands.
    

>From http://www.postgresql.org/docs/8.1/interactive/release-8-0.html:

# Add pg_get_serial_sequence() to return a SERIAL column's sequence name
(Christopher)

  


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.

Thanks


This allows automated scripts to reliably find the SERIAL sequence name. 

If you use a 7.x copy of pg_dump it might work, though there could be
catalog changes that make that a problem.
  

--------------000708010503020204000004--