Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>, "Boris P(dot) Korzun" <drtr0jan(at)yandex(dot)ru>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Date: 2021-10-19 21:58:34
Message-ID: 2008944.1634680714@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

"Bossart, Nathan" <bossartn(at)amazon(dot)com> writes:
> On 10/19/21, 12:54 PM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2021-10-20 03:47:04 Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
Previous Message Bossart, Nathan 2021-10-19 21:01:13 Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-10-19 22:12:51 Re: ALTER INDEX .. RENAME allows to rename tables/views as well
Previous Message John Naylor 2021-10-19 21:57:31 Re: [RFC] building postgres with meson