Re: pg_restore --no-post-data and --post-data-only

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Josh Berkus <josh@agliodbs.com>, Robert Haas <robertmhaas@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Alvaro Herrera <alvherre@commandprompt.com>, Jim Nasby <jim@nasby.net>
Date: 2011-12-07T17:48:26Z
Lists: pgsql-hackers

On 12/07/2011 11:31 AM, Tom Lane wrote:
> Josh Berkus<josh@agliodbs.com>  writes:
>>>> Note that this feature has the odd effect that some constraints are loaded at the same time as the tables and some are loaded with the post-data.  This is consistent with how text-mode pg_dump has always worked, but will seem odd to the user.  This also raises the possibility of a future pg_dump/pg_restore optimization.
>>> That does seem odd.  Why do we do it that way?
>> Beats me.
> Performance, mostly --- we prefer to apply checks during the original
> data load if possible, but for indexes and FK constraints it's faster to
> apply them later.  Also, we can separate constraints from the original
> table declaration if it's necessary to break a reference circularity.
> This isn't something that would be wise to whack around.
>
> 			


Yeah, and if we did want to change it that should be a TODO and not hold 
up this feature.

cheers

andrew