I dont get it, dump / restore failures to the same cluster.

From: Michael Ben-Nes <miki(at)canaan(dot)co(dot)il>
To: postgresql <pgsql-general(at)postgresql(dot)org>
Subject: I dont get it, dump / restore failures to the same cluster.
Date: 2006-05-24 19:44:59
Message-ID: 4474B7BB.5070902@canaan.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

I did on the same server / cluster ( 8.0.1 / ISO-8859-8 )

pg_dump -Fc sourcedb > sourcedb-Fc.dump

pg_dump -a sourcedb > sourcedb.dump

createdb test

pg_restore -c -s -d test sourcedb-Fc.dump

psql test < sourcedb.dump

I got few errors ( here are some of them ):

ERROR: insert or update on table "logo_product" violates foreign key constraint "logo_product_product_id_fkey"
DETAIL: Key (product_id)=(2) is not present in table "product".
ERROR: insert or update on table "order_coupon" violates foreign key constraint "order_coupon_redeem_order_id_fkey"
DETAIL: Key (redeem_order_id)=(3) is not present in table "orders".
ERROR: insert or update on table "order_product" violates foreign key constraint "order_product_order_id_fkey"
DETAIL: Key (order_id)=(3) is not present in table "orders".
ERROR: insert or update on table "order_product_property" violates foreign key constraint

I checked the source DB and it has a product with (product_id)=(2)
Whats wrong, is pg_dump so unreliable ?

I want to dump 8.0.1 databases and move them to a newer server / cluster. but its impossible if pg_dump not dumping accurate data.

Thanks for the help
Miki

--

--------------------------------------------------
Michael Ben-Nes - Internet Consultant and Director.
http://www.epoch.co.il - weaving the Net.
Cellular: 054-4848113
--------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leonel Nunez 2006-05-24 19:53:11 Binary Packages
Previous Message Tom Lane 2006-05-24 19:44:46 Re: PK with an expression in field list