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

From: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
To: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: 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-05-18 02:42:40
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 5/7/23 3:14 PM, Pavel Luzanov wrote:
> On 05.05.2023 19:51, David G. Johnston wrote:
>> But if it is really a blocker then maybe we should produce 3 separate
>> newline separated columns, one for the member of role, one for the
>> list of attributes, and one with the grantor.  The column headers can
>> be translated more easily as single nouns.  The readability quite
>> probably would end up being equivalent (maybe even better) in tabular
>> form instead of sentence form.
> Just to visualize this approach. Below are the output for the tabular
> form and the sentence form from last patch version (sql script attached):
> 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)Sentence form from patch v7     rolname      |                           memberof ------------------+-------------------------------------------------------------- postgres         |  regress_du_admin | regress_du_role0 from postgres (admin, inherit, set)        +                  | regress_du_role1 from postgres (admin, inherit, set)        +                  | regress_du_role2 from postgres (admin, inherit, set) regress_du_role0 |  regress_du_role1 | regress_du_role0 from regress_du_admin (admin, inherit, set)+                  | regress_du_role0 from regress_du_role1 (inherit)            +                  | regress_du_role0 from regress_du_role2 (set) regress_du_role2 | regress_du_role0 from regress_du_admin (admin)              +                  | regress_du_role0 from regress_du_role1 (inherit, set)       +                  | regress_du_role0 from regress_du_role2 (empty)              +                  | regress_du_role1 from regress_du_admin (admin, set)(5 rows)
> The tabular form solves the latest patch translation problems mentioned by Kyotaro.
> But it requires mapping elements between 3 array-like columns.
> To move forward, needs more opinions?

[RMT Hat]

Nudging this along, as it's an open item. It'd be good to get this
resolved before Beta 1, but that may be tough at this point.

[Personal hat]

I'm probably not the target user for this feature, so I'm not sure how
much you should weigh my opinion (e.g. I still don't agree with
explicitly showing "empty", but as mentioned, I'm not the target user).

That said, from a readability standpoint, it was easier for me to follow
the tabular form vs. the sentence form.



In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message reid.thompson 2023-05-18 03:07:03 Re: Add the ability to limit the amount of memory that can be allocated to backends.
Previous Message Andrew Dunstan 2023-05-18 01:54:59 Re: issue with meson builds on msys2