Skip site navigation (1) Skip section navigation (2)

Re: BUG #2308: pg_dump -a does not respect referential dependencies

From: Jim Nasby <decibel(at)decibel(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Matthew George" <georgema(at)corp(dot)earthlink(dot)net>,pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2308: pg_dump -a does not respect referential dependencies
Date: 2006-03-08 22:02:01
Message-ID: 4546D7A0-C7BE-4616-8798-F2E95A88518F@decibel.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Mar 8, 2006, at 3:01 PM, Tom Lane wrote:

> "Matthew George" <georgema(at)corp(dot)earthlink(dot)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(at)decibel(dot)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?"



In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-03-08 22:37:08
Subject: Re: BUG #2308: pg_dump -a does not respect referential dependencies
Previous:From: Tom LaneDate: 2006-03-08 21:15:45
Subject: Re: BUG #2304: Time zone bug: '05:04 GMT+3' processing as '05:04:00 -03'

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group