Re: pg_dump table ordering bug [8.0.1] - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_dump table ordering bug [8.0.1]
Date
Msg-id 26902.1108049394@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump table ordering bug [8.0.1]  ("Gerard Krupa" <Gerard.Krupa@marconi.com>)
List pgsql-bugs
"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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #1473: Backend bus error, possibly due to ANALYZE
Next
From: "Brian B."
Date:
Subject: Re: BUG #1473: Backend bus error, possibly due to ANALYZE