In this post, I am sharing in one script to find which group roles are granted to user in PostgreSQL.
As a DBA, when you are managing a number of database users and connections at that time it is very important to find a list of assigned roles for different user.
Using this single script you can easily find a list of users and its assigned roles.
pg_get_userbyid(roleid) AS GroupRoleName
,pg_get_userbyid(member) AS GrantedUserName
,pg_get_userbyid(grantor) AS GrantorUserName
,admin_option AS HasAdminOption
WHERE pg_get_userbyid(roleid) = 'User_Name';
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.