Re: Add pg_get_acl() function get the ACL for a database object

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pg_get_acl() function get the ACL for a database object
Date: 2024-07-05 01:13:06
Message-ID: ZodIoki-O0MD0N6A@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2024-07-05 03:59:11 Re: Add new COPY option REJECT_LIMIT
Previous Message Richard Guo 2024-07-05 01:00:47 Re: Support "Right Semi Join" plan shapes