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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pablo Alonso-Villaverde Roza <pavroza@xxxxxxxxx> 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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux