Re: Wrong starting value of sequences after doing pg_dump

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Wrong starting value of sequences after doing pg_dump
Date: 2010-10-08 18:25:07
Message-ID: 4CAF6203.9020602@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/08/2010 11:17 AM, Dennis Gearon wrote:
> I did a pg_dump of a database.
>
> All the sequences ended up with starting values of 1. Since this is not an empty database, this is all wrong.
>
> Is there anything I need to do at command time to change that or is it a bug?
>
> \set in psql gives:
>
> PostgreSQL 8.4.5 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit
>
> Dennis Gearon
>
> Signature Warning
> ----------------
> It is always a good idea to learn from your own mistakes. It is usually a better idea to learn from others’ mistakes, so you do not have to make them yourself. from 'http://blogs.techrepublic.com.com/security/?p=4501&tag=nl.e036'
>
> EARTH has a Right To Life,
> otherwise we all die.
>

In the dumps I have seen they initially get set to 1, then further on in
the file a setval is done to get them to the right value. Have you
looked for that yet?

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-10-08 18:32:10 Re: LOG: unexpected EOF on client connection
Previous Message Dennis Gearon 2010-10-08 18:17:20 Wrong starting value of sequences after doing pg_dump