How to display ALL privileges for a role using SQL?

From: Marc Richter <mail(at)marc-richter(dot)info>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to display ALL privileges for a role using SQL?
Date: 2016-09-05 13:13:00
Message-ID: 4deb8bff-8d29-6714-457b-521f1ca3cd47@marc-richter.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi everyone,

The subject says it all: How can I get a list of all privileges, a given
role may have, globally?
All I know is a role name, what I'd like to know is:
* what DBs are owned by that role?
* what tables, views, functions, schemas, databases, ... does that role
have permissions on (and which ones?)

I don't succeed after searching the web four hours..

It should be SQL queries, no psql commands like \l .

To give an example: Given, there is a Pg server with several roles, and
my job description is "Create a new user, exactly like user XY", how do
I get all information I need by asking the machine for details?

Best regards,
Marc

Browse pgsql-novice by date

  From Date Subject
Next Message Marc Richter 2016-09-05 13:17:16 How to display default privileges?
Previous Message Mike 2016-09-05 03:14:09 Re: alter role - superuser - permissions