Re: Enhancement request for pg_dump

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Sergei Agalakov <Sergei(dot)Agalakov(at)getmyle(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Enhancement request for pg_dump
Date: 2016-04-17 14:52:48
Message-ID: 20160417105248.d20dcefed39b5d9031c6b28d@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 16 Apr 2016 13:33:21 -0600
Sergei Agalakov <Sergei(dot)Agalakov(at)getmyle(dot)com> wrote:

> 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

--
Bill Moran

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sergei Agalakov 2016-04-17 18:23:02 Enhancement request for pg_dump
Previous Message Joshua D. Drake 2016-04-17 14:40:09 Re: $foo $bar is BAD