pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Manmeet Singh <manmeetsdba@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Role Permission issue
Date: Fri, 10 Feb 2023 12:04:49 +0100 (CET)
Message-ID: <880018050.326226.1676027089991@office.mailbox.org> (raw)
In-Reply-To: <CANgqwXd6W9aZub+C-V9XCvLqh93NXb+SzwQ-9htH+fXg-eq3UA@mail.gmail.com>
References: <CANgqwXd6W9aZub+C-V9XCvLqh93NXb+SzwQ-9htH+fXg-eq3UA@mail.gmail.com>

> 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





view thread (2+ messages)

Message-ID: <880018050.326226.1676027089991@office.mailbox.org>
Permalink:  ../880018050.326226.1676027089991@office.mailbox.org/
Also on:    postgresql.org/message-id/880018050.326226.1676027089991@office.mailbox.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ewie@ewie.name, manmeetsdba@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Role Permission issue
  In-Reply-To: <880018050.326226.1676027089991@office.mailbox.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox