Avoid duplicated rows when restoring data from pg_dumpall ??

Поиск
Список
Период
Сортировка
От Pablo Alonso-Villaverde Roza
Тема Avoid duplicated rows when restoring data from pg_dumpall ??
Дата
Msg-id fbd3fefa0908240354i53d95667i9239477d3927bf9e@mail.gmail.com
обсуждение исходный текст
Ответы Re: Avoid duplicated rows when restoring data from pg_dumpall ??
Список pgsql-admin
Hi all,

I'm getting duplicated rows in some of my tables when I try to restore data from a dump file generated with 'pg_dumpall'.
I use:
   pg_dumpall -c -U postgres > mybackup.sql
to dump all the data, roles, etc. into a file.

Then I try to restore the data using:
   psql -U postgres -f mybackup.sql

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.

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.

How can I get a "clean" restore automatically? I mean, getting exactly the same data there was on the server at the moment I made the 'pg_dumpall'

Excuse me for my poor English, by the way.

Thanks in advance,


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

Предыдущее
От: Andy Shellam
Дата:
Сообщение: Re: Background color in query tool
Следующее
От: Geoffrey
Дата:
Сообщение: Re: 32bit and 64bit cluster with shared data silo