Re: PostgreSQL 9.1 pg_dump setval() sets wrong value

From: Greg Donald <gdonald(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL 9.1 pg_dump setval() sets wrong value
Date: 2011-12-28 15:51:24
Message-ID: CAO+WgCYKOZJkwqtEOdfLiLtmBwmHRCpG3hxEQK9afW+7Q0AenA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 28, 2011 at 9:30 AM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> wrote:
> Wonder if it is related to this:
> http://archives.postgresql.org/pgsql-bugs/2011-11/msg00098.php

None of my sequences are named 'new'. What do you mean?

> Might want to file bug report:
> http://www.postgresql.org/support/submitbug/
>
> In the meantime what about using 8.4 pg_dump to create dump file and then using
> that file to load 9.1 server.

That's an option. When I upgraded to PostgreSQL 9.1 on my Ubuntu
11.10 workstation, I noticed apt did not make me uninstall my old 8.4
version. Seemed happy to leave them both installed.

I found a number of sequence fixing options:

http://stackoverflow.com/questions/244243/how-to-reset-postgres-primary-key-sequence-when-it-falls-out-of-sync

Right now I just have a long list of

ALTER SEQUENCE sequence_name RESTART WITH (SELECT max(id) FROM table_name);

to fix things up for me on my local setup.

--
Greg Donald

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Donald 2011-12-28 16:03:34 Re: PostgreSQL 9.1 pg_dump setval() sets wrong value
Previous Message Adrian Klaver 2011-12-28 15:30:29 Re: PostgreSQL 9.1 pg_dump setval() sets wrong value