Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that
Date
Msg-id CABAq_6HHiXWwY2juWCTMGFyH-h+XcFOjCOE5nH=VNSLZ6v9S-w@mail.gmail.com
Whole thread Raw
In response to Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that
List 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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Typo in doc or wrong EXCLUDE implementation
Next
From: Tom Lane
Date:
Subject: Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that