Re: [PATCH] pg_permissions - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [PATCH] pg_permissions
Date
Msg-id 20210325151637.GA12316@alvherre.pgsql
Whole thread Raw
In response to Re: [PATCH] pg_permissions  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: [PATCH] pg_permissions  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
On 2021-Mar-25, Joel Jacobson wrote:

> pg_shdepend doesn't contain the aclitem info though,
> so it won't work for pg_permissions if we want to expose
> privilege_type, is_grantable and grantor.

Ah, of course -- the only way to obtain the acl columns is by going
through the catalogs individually, so it won't be possible.  I think
this could be fixed with some very simple, quick function pg_get_acl()
that takes a catalog OID and object OID and returns the ACL; then
use aclexplode() to obtain all those details.

> The semantics will not be entirely the same,
> since internal objects are not tracked in pg_shdepend,
> but I think this is an improvement.

I just realized that pg_shdepend will not show anything for pinned users
(the bootstrap superuser).  I *think* this is not a problem.

-- 
Álvaro Herrera                            39°49'30"S 73°17'W
"E pur si muove" (Galileo Galilei)



pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: FETCH FIRST clause PERCENT option
Next
From: Justin Pryzby
Date:
Subject: Re: [PATCH] Add extra statistics to explain for Nested Loop