pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Terry Lee Tucker <terry@chosen-ones.org>
To: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Dumping/Restoring with constraints?
Date: Wed, 27 Aug 2008 09:29:41 -0400
Message-ID: <200808270929.42049.terry@chosen-ones.org> (raw)
In-Reply-To: <e373d31e0808270619uba31c8eodc2c85662b85140a@mail.gmail.com>
References: <e373d31e0808270619uba31c8eodc2c85662b85140a@mail.gmail.com>

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@turbocorp.com
www.turbocorp.com



view thread (36+ messages)  latest in thread

Message-ID: <200808270929.42049.terry@chosen-ones.org>
Permalink:  ../200808270929.42049.terry@chosen-ones.org/
Also on:    postgresql.org/message-id/200808270929.42049.terry@chosen-ones.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: terry@chosen-ones.org, pgsql-general@postgresql.org
  Subject: Re: Dumping/Restoring with constraints?
  In-Reply-To: <200808270929.42049.terry@chosen-ones.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox