Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check all roles/user/group_role have what privileges in postgres database?

I have postgres database. I want the list of users with access privileges they are being assigned.

I tried to find query and also looked in to psql command line help. (\nu and all) but I haven't found any usefull information.

Is anyone knows about that can help me out.

Thanks.

like image 559
Jayesh Avatar asked Sep 02 '25 10:09

Jayesh


1 Answers

Here as a supplement to the previous.

To check the privileges of user by following:

SELECT * FROM pg_user;

As the same way, to check roles:

SELECT * FROM pg_roles;
like image 142
Ricky Xu Avatar answered Sep 04 '25 00:09

Ricky Xu