Re: psql: Add role's membership options to the \du+ command
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>,
Pavel Luzanov <p.luzanov@postgrespro.ru>,
David Zhang <david.zhang@highgo.ca>,
"pgsql-hackers@lists.postgresql.org"
<pgsql-hackers@lists.postgresql.org>
Date: 2023-04-04T17:12:33Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I'm not sure what the right thing to do is here. It's a problem to
> have new information in the catalogs that you can't view via
> \d<whatever>. But displaying that information as a string of
> characters that will be gibberish to anyone but an expert doesn't
> necessarily seem like it really solves the problem. However, if we
> spell out the words, then it gets bulky. But maybe bulky is better
> than incomprehensible.
The existing precedent in \du definitely leans towards "bulky":
regression=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
alice | Cannot login | {bob}
bob | Cannot login | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
It seems pretty inconsistent to me to treat the role attributes this
way and then economize in the adjacent column.
Another advantage to spelling out the SQL keywords is that it removes
the question of whether we should translate them.
I wonder if, while we're here, we should apply the idea of
joining-with-newlines-not-commas to the attributes column too.
That's another source of inconsistency in the proposed display.
regards, tom lane
Commits
-
Add psql \drg command to display role grants.
- d65ddaca93f6 17.0 landed
- 0a1d2a7df852 16.0 landed