Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Date
Msg-id 1737876.1634613552@sss.pgh.pa.us
Whole thread Raw
In response to Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
List pgsql-bugs
Masahiko Sawada <sawada.mshk@gmail.com> writes:
> I've looked at the patch proposed you proposed. If we can depend on
> acldefault() being STRICT (which is legitimate to me), I think we
> don't need to build an expression depending on the caller (i.g.,
> is_default_acl). If acldefault() were to become not STRICT, we could
> detect it by regression tests. What do you think?

FWIW, I'm working on a refactoring of this logic that will bring the
acldefault() call into the getDefaultACLs code, which would mean that
we won't need that assumption anymore anyway.  The code as I have it
produces SQL like

     acldefault(CASE WHEN defaclobjtype = 'S'
                THEN 's'::"char" ELSE defaclobjtype END, defaclrole) AS acldefault

and we could wrap the test-for-zero around that:

     CASE WHEN defaclnamespace = 0 THEN
       acldefault(CASE WHEN defaclobjtype = 'S'
                  THEN 's'::"char" ELSE defaclobjtype END, defaclrole)
     ELSE NULL END AS acldefault

(although I think it might be better to write ELSE '{}' not ELSE NULL).

So I think we don't need to worry about whether acldefault() will stay
strict.  This patch will only need to work in the back branches.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Noah Misch
Date:
Subject: Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data
Next
From: "Bossart, Nathan"
Date:
Subject: Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES