Обсуждение: 20160417105248.d20dcefed39b5d9031c6b28d@potentialtech.com

Поиск
Список
Период
Сортировка

20160417105248.d20dcefed39b5d9031c6b28d@potentialtech.com

От
Sergei Agalakov
Дата:
I know about DBSteward. I don't like to bring PHP infrastructure only to
be able to compare two dumps,
and to deal with potential bugs in the third party tools. The pg_dump in
other hand is always here, and is always trusted.
SQLWorkbench/J also can compare two schemas, and requires only Java.
Again, I trust pg_dump more.
http://www.sql-workbench.net/

May be pg_dump was never INTENDED to generate the dump files with the
determined order of the statements,
but it CAN do it with the minor changes, and be more useful to
administrators. Why rely on the third party tools
for the tasks that can be done with the native, trusted tools?

Sergei

 >> Hi,
 >>
 >> Currently as in PG 9.4, 9.5 the order of the statements in the script
 >> produced by pg_dump is uncertain even for the same versions of the
 >> databases and pg_dump.
 >> One database may script grants like
 >>
 >> REVOKE ALL ON TABLE contracttype FROM PUBLIC;
 >> REVOKE ALL ON TABLE contracttype FROM madmin;
 >> GRANT ALL ON TABLE contracttype TO madmin;
 >> GRANT SELECT ON TABLE contracttype TO mro;
 >> GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE contracttype TO musers;
 >>
 >> and the other may change the order of grants like
 >>
 >> REVOKE ALL ON TABLE contracttype FROM PUBLIC;
 >> REVOKE ALL ON TABLE contracttype FROM madmin;
 >> GRANT ALL ON TABLE contracttype TO madmin;
 >> GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE contracttype TO musers;
 >> GRANT SELECT ON TABLE contracttype TO mro;
 >>
 >> It complicates the usage of pg_dump to compare the structures of the
two
 >> similar databases like DEV and PROD, two development branches etc.
 > I don't think pg_dump was ever intended to serve that purpose.
 >
 > dbsteward, on the other hand, does what you want:
 > https://github.com/nkiraly/DBSteward/wiki
 >



Re: 20160417105248.d20dcefed39b5d9031c6b28d@potentialtech.com

От
Rob Sargent
Дата:
> On Apr 17, 2016, at 12:41 PM, Sergei Agalakov <Sergei.Agalakov@getmyle.com> wrote:
>
> I know about DBSteward. I don't like to bring PHP infrastructure only to be able to compare two dumps,
> and to deal with potential bugs in the third party tools. The pg_dump in other hand is always here, and is always
trusted.
> SQLWorkbench/J also can compare two schemas, and requires only Java. Again, I trust pg_dump more.
> http://www.sql-workbench.net/
>
> May be pg_dump was never INTENDED to generate the dump files with the determined order of the statements,
> but it CAN do it with the minor changes, and be more useful to administrators. Why rely on the third party tools
> for the tasks that can be done with the native, trusted tools?
>
> Sergei
Does it matter if they differ if you cannot recreate the correct one exactly from source-controllled DDL?  Or know how
theyare supposed to differ if this is a migration point?