Re: sequences not restoring properly

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sequences not restoring properly
Дата
Msg-id 25843.1137782291@sss.pgh.pa.us
обсуждение исходный текст
Ответ на sequences not restoring properly  (Brian Dimeler <briand@lserve.com>)
Список pgsql-general
Brian Dimeler <briand@lserve.com> writes:
> In the database dump however, this default is omitted (and consequently, when restoring, the new
> server creates an implicit sequence named 'bands_dbbandcode_seq' instead of the correct
> bands_dbcode_seq, and it is never set to the correct value).

> This happens for a few other tables too; basically anything that had its serial columns or tables
> renamed at some point doesn't get its sequences re-created.

Oh, they're created all right.  But they're created according to what
the name ought to be now given the new column name, and the setval()
commands in the old dump are wrong for that.

Per Doug's response, use the 8.1 pg_dump if you can, as it knows how to
generate setval() calls that can deal with this effect.  There's no
very good solution for it in 7.4 unfortunately --- if you want to use
the old pg_dump, you have to do the setvals by hand after loading the
dump.

Note that you'd have the same problem trying to reload that dump into
7.4 ...

            regards, tom lane

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

Предыдущее
От: Brian Dimeler
Дата:
Сообщение: Re: sequences not restoring properly
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: sequences not restoring properly