Feature proposal: list role members in psql - Mailing list pgsql-hackers

From Anssi Kääriäinen
Subject Feature proposal: list role members in psql
Date
Msg-id 4F72EE0A.6080709@thl.fi
Whole thread Raw
Responses Re: Feature proposal: list role members in psql  (David Fetter <david@fetter.org>)
List pgsql-hackers
It seems there is no way to get role members using psql. \du and \dg
give you "this role is a member of" information, but no information
about who have been granted the role.

I would like to write a patch implementing this feature. Some questions:  - Is this wanted?  - Should there be a new
flagfor this: \du[m+] where m list the role  
memebers. Or could this be added to the '+' flag?  - Any pointers for patches implementing a similar addition to psql?
That would help me a lot, as I do not know the code base.  - Should the roles be fetched recursively, or should it be
justthe  
direct role members? My opinion is that direct role members is what is
wanted.

The output would be something like:
 Role name |  Attributes  |       Member of        | Role members
-----------+--------------+------------------------+--------------- hot2_dba  | Cannot login | {hot2_user,common_dba} |
{akaariai}

 - Anssi Kääriäinen


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: poll: CHECK TRIGGER?
Next
From: Thom Brown
Date:
Subject: Re: pgsql_fdw, FDW for PostgreSQL server