Re: psql: Add role's membership options to the \du+ command - Mailing list pgsql-hackers

From Jonathan S. Katz
Subject Re: psql: Add role's membership options to the \du+ command
Date
Msg-id 6b64c59a-fe41-bb07-d0cd-856896412b00@postgresql.org
Whole thread Raw
In response to Re: psql: Add role's membership options to the \du+ command  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Responses Re: psql: Add role's membership options to the \du+ command
List 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_role0from 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
fromregress_du_role1 (inherit)            +                  | regress_du_role0 from regress_du_role2
(set) regress_du_role2| regress_du_role0 from regress_du_admin (admin)              +                  |
regress_du_role0from 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.

Thanks,

Jonathan


Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: issue with meson builds on msys2
Next
From: reid.thompson@crunchydata.com
Date:
Subject: Re: Add the ability to limit the amount of memory that can be allocated to backends.