Postgres BackUp and Restore: ERROR: duplicate key violates unique constraint "pg_largeobject_loid_pn_index"

From: CM J <postgres(dot)newbie(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Postgres BackUp and Restore: ERROR: duplicate key violates unique constraint "pg_largeobject_loid_pn_index"
Date: 2009-05-12 11:55:26
Message-ID: d65fd1a40905120455k5a19af88g11ca633c751da502@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I backup my database using the following command:

pg_dump.exe -f Backup.sql -U <username> -p <port> MYDB

Now,before restoring, i drop all my tables,indexes,foreign key
constraints.Then, i restore using the cmd below:

psql.exe -U <username> -p <port>-d MYDB -f Backup.sql

The above results in following exception and the data is not getting
restored:

ERROR: duplicate key violates unique constraint
"pg_largeobject_loid_pn_index"

What else do i need to drop/delete to completely reinitialize my
database ? Also, instead of dropping the tables,indexes,foreign key
constraints, if drop the database and recreate it, the above error is not
thrown.However, this approach is not an option for me due to some limitation
in my application.

Kindly help.

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2009-05-12 12:06:25 Re: Putting many related fields as an array
Previous Message WP Perquin 2009-05-12 11:43:53 regexp_matches problem