Predictable order of SQL commands in pg_dump - Mailing list pgsql-hackers

From Dmitry Koterov
Subject Predictable order of SQL commands in pg_dump
Date
Msg-id d7df81620809201805m470993c2o816bc62124c77bf6@mail.gmail.com
Whole thread Raw
Responses Re: Predictable order of SQL commands in pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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?


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [patch] fix dblink security hole
Next
From: Tom Lane
Date:
Subject: Re: Predictable order of SQL commands in pg_dump