Thread: Role Permission issue

Role Permission issue

From
Manmeet Singh
Date:
Hi Team,

We have created one role and assign the permission to that role for example: Select on all tables.

Now i want to find out, what permissions we do have in this role..

Kindly help to provide the info on it.


Thanks
Manmeet Singh

Re: Role Permission issue

From
Erik Wienhold
Date:
> On 10/02/2023 09:14 CET Manmeet Singh <manmeetsdba@gmail.com> wrote:
>
> We have created one role and assign the permission to that role for example:
> Select on all tables.
>
> Now i want to find out, what permissions we do have in this role..

The ACL is spread over multiple tables, depending on the object type:
https://www.postgresql.org/docs/15/ddl-priv.html#PRIVILEGES-SUMMARY-TABLE

You can search for specific roles using aclexplode and filtering on grantee:

    select relnamespace::regnamespace, relname, acl.*
    from pg_class, aclexplode(relacl) acl
    where acl.grantee = 'alice'::regrole

But you have to query each object type (pg_class, pg_proc, etc.) separately.

--
Erik