Feature proposal: list role members in psql

From: Anssi Kääriäinen <anssi(dot)kaariainen(at)thl(dot)fi>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Feature proposal: list role members in psql
Date: 2012-03-28 10:55:06
Message-ID: 4F72EE0A.6080709@thl.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 flag for 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 just the
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2012-03-28 11:00:40 Re: pgsql_fdw, FDW for PostgreSQL server
Previous Message Heikki Linnakangas 2012-03-28 09:49:59 Re: poll: CHECK TRIGGER?