Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: 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:01:13
Message-ID: 2C411167-8492-497B-A110-81E7081B1B0E@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

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. Why aren't we simply regurgitating the pg_default_acl entries
> verbatim? That is, I think maybe we don't need the acldefault call at
> all; we should just use null/empty as the starting ACL in all cases
> when printing pg_default_acl entries. Like this:

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;

This command is effectively ignored when you apply it, as no entry is
added to pg_default_acl. I haven't looked too closely into what's
happening yet, but it does look like there is more to the story.

Nathan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-10-19 21:58:34 Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Previous Message Tom Lane 2021-10-19 19:53:54 Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-10-19 21:27:30 Re: Refactoring pg_dump's getTables()
Previous Message Greg Stark 2021-10-19 20:58:47 Re: Extending amcheck to check toast size and compression