We actually follow the following order while doing restore
1) disable triggers
2) drop the foreign key constraints only
3) truncate all the existing tables
4) do the restore
5) recreate the constraints
6) enable triggers
Tom Lane wrote:
> Pushker Chaubey <pchaubey(at)vertex(dot)co(dot)in> writes:
>> We took back up of a database using the following command
>> pg_dump -a
>> In the back up file that was generated we found some data that was
>> violating foreign key constraints. And there fore we were not able to
>> restore database back with this back up file.
> Was the data actually erroneous, or just loaded in the wrong order
> (ie, referencing table before referenced one)? pg_dump -a doesn't
> guarantee to use a safe reload order.
> regards, tom lane
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy the original message all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
Please do not print this email unless it is absolutely necessary.
In response to
pgsql-jdbc by date
|Next:||From: Daniel Migowski||Date: 2008-06-26 14:36:57|
|Subject: Re: Data corruption while taking backup of database|
|Previous:||From: Tom Lane||Date: 2008-06-25 21:20:04|
|Subject: Re: Data corruption while taking backup of database |