Thread: How to display ALL privileges for a role using SQL?

How to display ALL privileges for a role using SQL?

From
Marc Richter
Date:
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