Re: psql: Add role's membership options to the \du+ command

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
Cc: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, David Zhang <david(dot)zhang(at)highgo(dot)ca>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, rmt(at)lists(dot)postgresql(dot)org, horikyota(dot)ntt(at)gmail(dot)com
Subject: Re: psql: Add role's membership options to the \du+ command
Date: 2023-06-15 18:47:56
Message-ID: CAKFQuwa7EDaN6wzK4TSym8KrN3oSXJmYNEDyWNGRd5qw1pyUFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert - can you please comment on what you are willing to commit in order
to close out your open item here. My take is that the design for this, the
tabular form a couple of emails ago (copied here), is ready-to-commit, just
needing the actual (trivial) code changes to be made to accomplish it.

Tabular form

rolname | memberof | options |
grantor ------------------+------------------+---------------------+------------------
postgres | | |
regress_du_admin | regress_du_role0+| admin, inherit, set+| postgres
+ | regress_du_role1+| admin, inherit, set+|
postgres + | regress_du_role2 | admin,
inherit, set | postgres regress_du_role0 | |
| regress_du_role1 | regress_du_role0+| admin, inherit,
set+| regress_du_admin+ | regress_du_role0+| inherit
+| regress_du_role1+ | regress_du_role0 |
set | regress_du_role2 regress_du_role2 |
regress_du_role0+| admin +| regress_du_admin+
| regress_du_role0+| inherit, set +| regress_du_role1+
| regress_du_role0+| empty +|
regress_du_role2+ | regress_du_role1 | admin, set
| regress_du_admin(5 rows)

On Thu, May 18, 2023 at 6:07 AM Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
wrote:

> On 18.05.2023 05:42, Jonathan S. Katz wrote:
>
> That said, from a readability standpoint, it was easier for me to follow
> the tabular form vs. the sentence form.
>
> May be possible to reach a agreement on the sentence form. Similar descriptions used
> for referential constraints in the \d command:
>
> I think we should consider the tabular form with translatable headers to
be the acceptable choice here. I don't see enough value in the sentence
form to make it worth trying to overcome the i18n objection there.

> As for tabular form it looks more natural to have a separate psql command
> for pg_auth_members system catalog. Something based on this query:But is it worth inventing a new psql command for this?
>
>
IMO, no. I'd much rather read "admin, inherit, set" than deal with
true/false in columns. I think the newlines are better compared to
repetition of the rolname as well.

I'm also strongly in favor of explicitly writing out the word "empty"
instead of leaving the column blank for the case that no options are marked
true. But it isn't a show-stopper for me.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2023-06-15 19:08:45 Re: [17] collation provider "builtin"
Previous Message Alvaro Herrera 2023-06-15 17:48:44 Re: Non-superuser subscription owners