Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Script to find which group roles are granted to the User

In this post, I am sharing a script to find which group roles granted to the user in PostgreSQL.

As a DBA, when you are managing some database users and connections, it is very important to find a list of assigned roles for the different user.

Using this single script, you can easily find a list of users and its assigned roles:

SELECT 
 pg_get_userbyid(roleid) AS GroupRoleName
 ,pg_get_userbyid(member) AS GrantedUserName
 ,pg_get_userbyid(grantor) AS GrantorUserName
 ,admin_option AS HasAdminOption
FROM pg_auth_members 
WHERE pg_get_userbyid(roleid) = 'User_Name';

Comments

Popular posts from this blog

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

rman interview and scenario based questions and answer and also rman(backup and recovery) discussions panel

Oracle to Postgresql migration

VBOX installation full guide