pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Luís Sousa <llsousa@ualg.pt>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Problem using pg_restore with -a option
Date: Fri, 01 Sep 2006 12:02:04 -0400
Message-ID: <5509.1157126524@sss.pgh.pa.us> (raw)
In-Reply-To: <44F84649.9050502@ualg.pt>
References: <44F84649.9050502@ualg.pt>

=?ISO-8859-1?Q?Lu=EDs_Sousa?= <llsousa@ualg.pt> writes:
> Using the schema below, doing a pg_dump -Fc, delete all data, and a
> pg_restore -a, the sequence of inserting data isn't correct issuing an
> error.

Data-only restores make no attempt to avoid foreign-key constraint
problems --- in general there is no solution, since you could have
circular constraints.

You could drop and re-add the FK constraints, or if you trust that the
data is valid there's the --disable-triggers option to suppress FK
constraint checking.

			regards, tom lane



view thread (3+ messages)

Message-ID: <5509.1157126524@sss.pgh.pa.us>
Permalink:  ../5509.1157126524@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5509.1157126524@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, llsousa@ualg.pt
  Subject: Re: Problem using pg_restore with -a option
  In-Reply-To: <5509.1157126524@sss.pgh.pa.us>
  References: <44F84649.9050502@ualg.pt> <5509.1157126524@sss.pgh.pa.us>

* 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