"Gerard Krupa" <Gerard.Krupa@marconi.com> writes:
> I've experienced a similar problem with a data-only dump using 8.0.1's
> pg_dump. It seems that the COPYs (or INSERTs) are generated in
> alphabetical order of table name, ignoring foreign key contraints and
> requiring the output to be post-processed. In a full dump of the database
> the constraints are added after the data is inserted so there are no
> problems. See the two attached dumps of the same database as an example.
This is not a bug. In a data-only dump pg_dump cannot hope to know what
FK constraints may be applied to the data at load time --- there's no
particularly good reason to assume they are the same as what was in the
source database. So it's your responsibility to order the loading steps
properly. See pg_restore's -l/-L switches.
regards, tom lane