Re: Avoid duplicated rows when restoring data from pg_dumpall ??

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Avoid duplicated rows when restoring data from pg_dumpall ??
Дата
Msg-id 11581.1251125232@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Avoid duplicated rows when restoring data from pg_dumpall ??  (Pablo Alonso-Villaverde Roza <pavroza@gmail.com>)
Ответы Re: Avoid duplicated rows when restoring data from pg_dumpall ??  (Pablo Alonso-Villaverde Roza <pavroza@gmail.com>)
Список pgsql-admin
Pablo Alonso-Villaverde Roza <pavroza@gmail.com> writes:
> I'm getting duplicated rows in some of my tables when I try to restore data
> from a dump file generated with 'pg_dumpall'.

Probably all of them, actually ...

> The only "way" I have found to solve this problem is deleting my database
> before restoring the data, so everything is 're-created' in the restore
> process without generating duplicated rows.

A pg_dumpall script expects to be restored into an empty cluster.  This
is not a bug.

> I thought, that the "-c" flag on pg_dumpall would force a DROP of any
> previous data structures on the server but...it looks like it doesn't work
> as I expected and ...when I restore data I get duplicated rows.

The -c flag should cause the script to DROP all your databases first.
But that switch has been known to have bugs in the past, and in any case
it could fail if there are other sessions connected to those databases.
Did you pay attention to whether the restore reported any errors?
What PG version is this?

            regards, tom lane

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

Предыдущее
От: Geoffrey
Дата:
Сообщение: Re: 32bit and 64bit cluster with shared data silo
Следующее
От: james bardin
Дата:
Сообщение: Re: warm standby and reciprocating failover.