Re: Add pg_get_acl() function get the ACL for a database object - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add pg_get_acl() function get the ACL for a database object
Date
Msg-id ZodIoki-O0MD0N6A@paquier.xyz
Whole thread Raw
In response to Re: Add pg_get_acl() function get the ACL for a database object  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
On Tue, Jul 02, 2024 at 12:38:07PM +0200, Joel Jacobson wrote:
> Rebased version.
> Uses ACL acronym added in commit 00d819d46a6f5b7e9d2e02948a1c80d11c4ce260:
>     doc: Add ACL acronym for "Access Control List"

Forgot to push the send button for this one yesterday, done now..

While looking at that, I've finished by applying what you have here as
it is good enough to retrieve any ACLs for all catalogs that don't use
a subobjid (aka everything except pg_attribute's ACL, for which
dependencies are stored with pg_class in pg_shdepend so we'd need a
shortcut in pg_get_acl() or more data in ObjectProperty but I'm not
much a fan of tracking in that the dependency between pg_attribute and
pg_class coming from pg_shdepend), with two tweaks:
- Slightly reshaped the code to avoid more blocks, even if it means
one more PG_RETURN_NULL().
- Moved the example outside the main function table as it was rather
complex, with some output provided that should fit in the width of
the PDF docs.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Support "Right Semi Join" plan shapes
Next
From: Fujii Masao
Date:
Subject: Re: Add new COPY option REJECT_LIMIT