Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>,
Michael Paquier <michael@paquier.xyz>,
Neil Chen <carpenter.nail.cz@gmail.com>,
"Boris P. Korzun" <drtr0jan@yandex.ru>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2021-10-19T21:58:34Z
Lists: pgsql-bugs, pgsql-hackers
"Bossart, Nathan" <bossartn@amazon.com> writes: > On 10/19/21, 12:54 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote: >> I kind of wonder now whether the existing behavior is correct for either >> case. > Hm. If we do this, then this command: > ALTER DEFAULT PRIVILEGES FOR ROLE myrole REVOKE ALL ON FUNCTIONS FROM PUBLIC; > is dumped as: > ALTER DEFAULT PRIVILEGES FOR ROLE myrole GRANT ALL ON FUNCTIONS TO myrole; [ pokes at it some more... ] Yeah, I just didn't have my head screwed on straight. We need the global entries to be dumped as deltas from the proper object-type-specific ACL, while the non-global ones should be dumped as grants only, which can be modeled as a delta from an empty ACL. So the patch should be good as given (though maybe the comment needs more work to clarify this). Sorry for the noise. regards, tom lane
Commits
-
pg_dump: fix mis-dumping of non-global default privileges.
- b1df061f704b 9.6.24 landed
- 871dfe4b7270 11.14 landed
- 52b927a731e5 12.9 landed
- 476006023538 13.5 landed
- 10f9faf6d873 10.19 landed
- 3ad2c2455be0 14.1 landed
- 2acc84c6fd29 15.0 landed