Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5

From: "Mason Hale" <masonhale(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5
Date: 2007-04-14 18:51:27
Message-ID: 8bca3aa10704141151l676f9b28ydc6eb1fb6a69a681@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/14/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Hmm ... which sequence is entry.id actually referring to on the source
> database? I suspect that it is linked to some differently-named
> sequence like "entry_id_seq1" and the source's "entry_id_seq" is not
> in truth doing anything (and, in particular, hasn't ever been advanced,
> so when the restore script sets its value to 1 it's clobbering the other
> sequence).

That was it, exactly. Thanks. I dropped the unused entry_id_seq, and renamed
the existing sequence using an ALTER TABLE .. RENAME TO statement.

The methodology that pre-8.2 pg_dump uses for serial columns is
> vulnerable to quite a number of problems if serial sequences don't have
> the expected names, and this seems to be another one.

I assume it would not be advisable to use the 8.2 version of pg_dump, if I
intend to restore to an 8.1 database, correct?

thanks again,
Mason

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2007-04-14 19:07:09 pg_dump seg fault on sequences
Previous Message Tom Lane 2007-04-14 16:49:07 Re: indexing array columns