Re: BUG #2308: pg_dump -a does not respect referential dependencies - Mailing list pgsql-bugs

From Jim Nasby
Subject Re: BUG #2308: pg_dump -a does not respect referential dependencies
Date
Msg-id 4546D7A0-C7BE-4616-8798-F2E95A88518F@decibel.org
Whole thread Raw
In response to Re: BUG #2308: pg_dump -a does not respect referential dependencies  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #2308: pg_dump -a does not respect referential dependencies  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Mar 8, 2006, at 3:01 PM, Tom Lane wrote:

> "Matthew George" <georgema@corp.earthlink.net> writes:
> The best practice is to do standard schema+data dumps, wherein the
> ordering problem can be handled properly by not creating the FK
> constraints until after the data is loaded.  If you really want to
> do a data-only restore, I'd suggest dropping the FK constraints
> and re-adding them afterwards (which will be a lot faster than
> row-by-row retail checks would be, anyway).

BTW, it would be really nice if we provided a better way to do this
than manually dropping all the FK constraints and adding them back in
later. Would it be difficult to allow deferring all constraints in
the database during a specified transaction? That would allow for
loading the data in a transaction and doing the constraint checking
later...
--
Jim C. Nasby, Database Architect                decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2304: Time zone bug: '05:04 GMT+3' processing as '05:04:00 -03'
Next
From: Tom Lane
Date:
Subject: Re: BUG #2308: pg_dump -a does not respect referential dependencies