Re: pg_restore and create FK without verification check - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_restore and create FK without verification check
Date
Msg-id 15395.1069863713@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_restore and create FK without verification check  (ow <oneway_111@yahoo.com>)
Responses Re: pg_restore and create FK without verification check  (ow <oneway_111@yahoo.com>)
Re: pg_restore and create FK without verification check  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-hackers
ow <oneway_111@yahoo.com> writes:
> --- Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Right, any such physical dump would be limited to restoring a whole
>> cluster as-is: no imports into other clusters, no selectivity, no fancy
>> games.

> But that would not help people who would HAVE to use pg_dump/pg_restore (e.g.
> to backup/restore a single schema), would it? Depending on the db size, etc.,
> creation of FK constraint(s) may take many hours. How should this be handled
> then?

Quite honestly, I think they should check their foreign keys.  In a
partial restore situation there is no guarantee that the referenced
table and the referencing table are being restored at the same time from
the same dump.  An override in that situation looks like a great tool
for shooting yourself in the foot.

People might be more interested in debating this topic with you if we
hadn't discussed it at length just a couple months back.  There wasn't
consensus then that we had to offer an escape hatch, and you've not
offered any argument that wasn't made before.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: detecting poor query plans
Next
From: Larry Rosenman
Date:
Subject: Re: 7.4final regression failure on uw713