Saturday, September 20, 2008

[HACKERS] Predictable order of SQL commands in pg_dump

Hello.

Utility pg_dump dumps the identical database schemas not always
identically: sometimes it changes an order of SQL statements.
E.g.:

1. Dump of database A:

ALTER TABLE xxx ADD CONSTRAINT ...;
ALTER TABLE yyy ADD CONSTRAINT ...;

2. Dump of database B which has identical structure as A ("pg_dump A |
psql -d B" was executed)

ALTER TABLE yyy ADD CONSTRAINT ...;
ALTER TABLE xxx ADD CONSTRAINT ...;

This behaviour is not good, because I cannot execute diff to visually
view what was changed between databases A and B. (I use this diff only
for visual detection, please do not refer I want to use this diff for
schema migration - I don't want it!).

Is it possible to make pg_dump more predictable in SQL ordering?
What order does it use by default?

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: