The following bug has been logged online:
Bug reference: 2335
Logged by: Jozef Behran
Email address: jozef(dot)behran(at)krs(dot)sk
PostgreSQL version: 8.1.0
Operating system: Linux (Mandriva Linux 10.0)
Description: Order of data in data-only dumps
When doing a data-only dump, the tables are dumped in alphabetical order.
This is unfortunate as I might want to fetch the file into a fully created
schema (including indices/constraints) for example to prevent bad data from
being fetched without an error ot to accomodate old data in a new schema and
the alphabetical order of the tables may be wrong.
Older versions (7.x particularly) ensure the order of the tables in the dump
is such that it can be fetched into fully created schema without problems.
It is OK to have the tables ordered aplabetically in full dumps as it is
unlikely to fetch such dump into something other than an empty database.
To see some problematic data try:
CREATE TABLE b (
CREATE TABLE a (
other int4 references b
on update cascade on delete cascade
INSERT INTO b VALUES (1);
INSERT INTO a VALUES (1,1);
pg_dump -a <database_name>
The pg_dump will dump a, then b but it should do it in reverse order.
I think the few more CPU cycles needed to sort the tables like in 7.x series
is not worth the reduced usability of the dumps when incorrect table order
is used. Especially when the order of data does not break anything even in
the full dump.
pgsql-bugs by date
|Next:||From: William ZHANG||Date: 2006-03-18 14:05:39|
|Subject: Re: BUG #2332: commands ignored until end of transaction block|
|Previous:||From: Tom Lane||Date: 2006-03-18 04:52:58|
|Subject: Re: BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation |