Re: PostgreSQL 9.1 pg_dump setval() sets wrong value

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Greg Donald <gdonald(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: PostgreSQL 9.1 pg_dump setval() sets wrong value
Date: 2011-12-28 22:58:46
Message-ID: 201112281458.46968.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, December 28, 2011 1:02:39 pm Greg Donald wrote:
> On Wed, Dec 28, 2011 at 1:00 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Greg Donald <gdonald(at)gmail(dot)com> writes:
> >>> Are you
> >>> sure that the sequence is being used to insert those values into the
> >>> table?
> >>
> >> When I insert a new row into either of the tables I previously
> >> described, the sequence 'Current value' increments by one.
> >
> > According to what?
>
> PgAdmin3. I'm assuming 'Current value' means the sequence 'START'
> value, they are just using a different label than the official
> PostgreSQL terminology.. I guess.

Actually it is showing the last_value. The CREATE SEQUENCE command pgAdmin shows
for the sequence uses that value as the START value for replicating the state of
the sequence.

>
> > In any case, it is highly, highly unlikely that pg_dump is the cause of
> > the problem.
>
>
> When I dumped a copy from 8.4 to go live in 9.1 it went in fine, no
> setval() value issues at all. It is only now that I have the 9.1
> version of pg_dump in place that restore problems are occurring.

What is the pg_dump command, with options, you are using?

>
> > It's just reporting what it finds in the database.
>
> Well, not in my case. In my database my sequences do not contains
> these incorrect '1' values I see in some of the setval() calls.
>

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben Chobot 2011-12-29 01:16:17 checking for table bloat
Previous Message Tom Lane 2011-12-28 22:57:55 Re: PostgreSQL 9.1 pg_dump setval() sets wrong value