Re: [HACKERS] Predictable order of SQL commands in pg_dump

2008-09-21 Thread Dmitry Koterov
Great! Would it be implemented in a next version? Seems it would be very helpful, especially for people who commit database structure to CVS/SVN once per minute to track changes history (or similar)... On Sun, Sep 21, 2008 at 11:57 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Dmitry Koterov" <[EMAI

Re: [HACKERS] Predictable order of SQL commands in pg_dump

2008-09-21 Thread Tom Lane
"Dmitry Koterov" <[EMAIL PROTECTED]> writes: > CREATE TRIGGER t000_set_id > -BEFORE INSERT OR DELETE OR UPDATE ON a > +BEFORE INSERT OR DELETE OR UPDATE ON b > FOR EACH ROW > EXECUTE PROCEDURE i_trg(); > CREATE TRIGGER t000_set_id > -BEFORE INSERT OR DELETE OR UPDATE ON b >

Re: [HACKERS] Predictable order of SQL commands in pg_dump

2008-09-21 Thread Dmitry Koterov
Unfortunately, I cannot reproduce this with 100% effect. But, time to time I execute diff utility for a database and notice that two or more trigger or constraint definitions (or something else) are permuted. Something like this: +ALTER TABLE ONLY a +ADD CONSTRAINT "fk_b_Id" FOREIGN KEY (b_i

Re: [HACKERS] Predictable order of SQL commands in pg_dump

2008-09-20 Thread Tom Lane
"Dmitry Koterov" <[EMAIL PROTECTED]> writes: > Utility pg_dump dumps the identical database schemas not always > identically: sometimes it changes an order of SQL statements. Please provide a concrete example. The dump order for modern servers (ie, since 7.3) is by object type, and within a type

[HACKERS] Predictable order of SQL commands in pg_dump

2008-09-20 Thread Dmitry Koterov
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