Re: how to list privileges on the database object itself via SQL? - Mailing list pgsql-admin

From richard coleman
Subject Re: how to list privileges on the database object itself via SQL?
Date
Msg-id CAGA3vBszC=LT-ABR8GUfO_y4Q3yEV+Urr29n8S_axiVQX_v0FA@mail.gmail.com
Whole thread Raw
In response to how to list privileges on the database object itself via SQL?  (richard coleman <rcoleman.ascentgl@gmail.com>)
List pgsql-admin
Holger, 

Thanks, that looks very good.

rik.

On Wed, Apr 26, 2023 at 2:23 PM Holger Jakobs <holger@jakobs.com> wrote:
Try this command:

with cte as (select oid, datname, (aclexplode(datacl)).* from
pg_database where oid>1)
   select cte.oid, datname, grantor.rolname as grantorname,
coalesce(grantee.rolname, 'public') as granteename, privilege_type,
is_grantable
   from cte
   join pg_authid grantor on cte.grantor = grantor.oid
   left join pg_authid grantee on cte.grantee = grantee.oid


--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

pgsql-admin by date:

Previous
From: Erik Wienhold
Date:
Subject: Re: how to list privileges on the database object itself via SQL?
Next
From: Erik Wienhold
Date:
Subject: Re: Am I being blacklisted?