Re: Show INHERIT in \du

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Show INHERIT in \du
Date: 2008-02-14 13:27:37
Message-ID: 20080214132737.GA5817@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Brendan Jurd escribió:
> Hello hackers,
>
> psql's \du command currently does not list the INHERIT role attribute.
> It does show the other privilege attributes (superuser, create role,
> create db), and INHERIT seems like the kind of thing a user
> executing\du would want to know.
>
> I'd like to add it to \du. The downside is that it would add width to
> an already rather wide output, but I see that as a worthwhile
> tradeoff. If I'm in the minority there, perhaps I could just add it
> to \du+?

I wonder if it's possible to create a more compact output -- say, a
fixed-width column, with a letter for each enabled attribute, or a space
in the respective position when the attribute is disabled. Legend of
letter at the bottom of the output, or some such. So instead of

alvherre=# \du
List of roles
Role name | Superuser | Create role | Create DB | Connections | Member of
-----------+-----------+-------------+-----------+-------------+-----------
alvherre | yes | yes | yes | no limit | {}
foo | no | no | yes | no limit | {}
(2 rows)

We would have something like

alvherre=# \du
List of roles
Role name | Attributes | Connections | Member of
-----------+------------+-------------+-----------
alvherre | SRDI | no limit | {}
foo | D | no limit | {}
(2 rows)
Attributes: S -- superuser
R -- create role
D -- create database
I -- inherit

For those that think that the \du output is currently OK because it
doesn't wrap, consider the french translation which is quite a bit wider
than the original:

alvherre=# \du
Liste des rôles
Nom du rôle | Superutilisateur | Créer un rôle | Créer une base | Connexions | Membre de
-------------+------------------+---------------+----------------+-------------+-----------
alvherre | oui | oui | oui | sans limite | {}
(1 ligne)

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2008-02-14 13:30:15 Re: wishlist for 8.4
Previous Message Bernd Helmle 2008-02-14 11:35:00 Re: Show INHERIT in \du

Browse pgsql-patches by date

  From Date Subject
Next Message Bernd Helmle 2008-02-14 14:29:29 Re: Show INHERIT in \du
Previous Message Phoenix Kiula 2008-02-14 12:31:26 PG quitting sporadically!!