Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that
Jacob Champion <pchampion@pivotal.io>
From: Jacob Champion <pchampion@pivotal.io>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2018-08-07T18:41:30Z
Lists: pgsql-hackers
On Tue, Aug 7, 2018 at 10:24 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I don't see any reason to insist on a test case before pushing this
> fix, so I did that. (As I expected, the fix doesn't change any existing
> regression test results.)
Thanks! We have made some progress towards a repro but we're having
problems putting it into the pg_dump suite. Here's a simple case for
you:
CREATE USER me;
CREATE SCHEMA a;
ALTER DEFAULT PRIVILEGES IN SCHEMA a GRANT UPDATE ON TABLES TO me;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON SEQUENCES TO me;
ALTER DEFAULT PRIVILEGES GRANT SELECT ON SEQUENCES TO me;
We dumped this from a newly created database (commit e0ee9305 from
master) and got the following order:
ALTER DEFAULT PRIVILEGES ... IN SCHEMA public REVOKE ALL ON SEQUENCES...
ALTER DEFAULT PRIVILEGES ... IN SCHEMA public GRANT SELECT ON SEQUENCES...
...
ALTER DEFAULT PRIVILEGES ... GRANT SELECT ON SEQUENCES...
...
ALTER DEFAULT PRIVILEGES ... IN SCHEMA a REVOKE ALL ON TABLES...
ALTER DEFAULT PRIVILEGES ... IN SCHEMA a GRANT UPDATE ON TABLES...
In this case, schema a should dump before public. If you switch the
first two ALTER DEFAULT PRIVILEGES lines in the reproduction SQL, you
should get a different (correct) ordering.
--Jacob
Commits
-
Ensure pg_dump_sort.c sorts null vs non-null namespace consistently.
- f7364300667b 11.0 landed
- f3f6558b5d76 9.5.15 landed
- dc391dacf170 10.6 landed
- abd04e0dd8a5 9.4.20 landed
- 6b6327d938ed 9.6.11 landed
- 5b5ed4756c9b 12.0 landed
- 5abdb33ad053 9.3.25 landed
-
Last-minute updates for release notes.
- e0ee93053998 12.0 cited