restoring databases with intensive foreign key use fails - Mailing list pgsql-general

From Tino Wildenhain
Subject restoring databases with intensive foreign key use fails
Date
Msg-id 18407047.1020816895@buzzer
Whole thread Raw
Responses Re: restoring databases with intensive foreign key use fails
Re: restoring databases with intensive foreign key use
List pgsql-general
Hi,

restoring the database only from pg_dump/pg_restore
seems to be impossible if one uses foreign keys much.
The tables referenced are most of the time not available
by the time the referencing tables are created. Even
restoring by OID order does not help.

How are people doing this? The only solution I found was
editing the restore script by hand and transform all
constraints to ALTER TABLE statements at the end.

The other problem was that there are apparently no user
information in the dump to restore users too.

What solutions are available?

I've tried to go thru the source code of pg_dump
buts a bit organic ;) I think it schould move
all constraints out of the table definition and
put them after the whole restore.

Regards
Tino

pgsql-general by date:

Previous
From: Martín Marqués
Date:
Subject: Re: restoreing dumps fail
Next
From: Martín Marqués
Date:
Subject: Re: restoreing dumps fail