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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5
Дата
Msg-id 4776.1176567575@sss.pgh.pa.us
обсуждение исходный текст
Ответ на error creating/setting sequence, pg_dump / pg_restore 8.1.5  ("Mason Hale" <masonhale@gmail.com>)
Ответы Re: error creating/setting sequence, pg_dump / pg_restore 8.1.5
Список pgsql-general
"Mason Hale" <masonhale@gmail.com> writes:
> After running pg_dump to backup my database, and then running pg_restore to
> load the db (on a different server),
> I run into a problem with creating a sequence.

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).

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.  8.2 would be able
to handle the case, but in 8.1 the best advice is to drop the unused
sequence to avoid the name collision when SERIAL picks plain "entry_id_seq"
as the serial sequence's name upon reload.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "Alain Roger"
Дата:
Сообщение: postgresql 8.1.4 to 8.2.3
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: indexing array columns