Re: [GENERAL] Dumping/Restoring with constraints?

This is a discussion on Re: [GENERAL] Dumping/Restoring with constraints? within the postgresql forums in Other Databases category; On Wednesday 27 August 2008 09:19, Phoenix Kiula wrote: > Hello. I have a database dump. With data and schema, which includes > all the constraints and rules. But it seems the pg_dumpall command > does not copy data in such a way that foreign keys are satisfied upon > restoring. Because tables are inter-related, importing them keep > giving errors and eventually no data is imported. Neither pg_dumpall > nor pg_restore seems to have a without constraints or delay > constraints check type command. What am I missing? Thanks for any > advice. We have all sorts of constraints and foreign keys and we have ...

Go Back   Database Forum > Other Databases > postgresql

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 10:29 AM
Default Re: [GENERAL] Dumping/Restoring with constraints?

On Wednesday 27 August 2008 09:19, Phoenix Kiula wrote:
> Hello. I have a database dump. With data and schema, which includes
> all the constraints and rules. But it seems the pg_dumpall command
> does not copy data in such a way that foreign keys are satisfied upon
> restoring. Because tables are inter-related, importing them keep
> giving errors and eventually no data is imported. Neither pg_dumpall
> nor pg_restore seems to have a "without constraints" or "delay
> constraints check" type command. What am I missing? Thanks for any
> advice.


We have all sorts of constraints and foreign keys and we have never had any
problem with pg_restore related to dumping such that foreign keys are
satisfied. You must have data already in the database that violates the
restraints. You can restore in two phases; that is, by restoring the schema,
and then the data using --disable-triggers. I'm assuming you are doing a
binary dump. See the man page for pg_restore.

HTH
--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry-at-turbocorp.com
www.turbocorp.com

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

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 09:36 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.