Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5 - Mailing list pgsql-general

From Mason Hale
Subject Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5
Date
Msg-id 8bca3aa10704141151l676f9b28ydc6eb1fb6a69a681@mail.gmail.com
Whole thread Raw
In response to Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general

On 4/14/07, Tom Lane <tgl@sss.pgh.pa.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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: indexing array columns
Next
From: "Michael Nolan"
Date:
Subject: pg_dump seg fault on sequences