public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pavel Luzanov <[email protected]>
To: David G. Johnston <[email protected]>
To: Jonathan S. Katz <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: David Zhang <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: psql: Add role's membership options to the \du+ command
Date: Sun, 7 May 2023 22:14:41 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwZiomZFLd5zK=feCjY7Weefvce1MR+k38wyBMbaP2ASsg@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+TgmoatW6D_iyyCqbKcjS6MQt-fBTWzmynruk+x1B8oz22kog@mail.gmail.com>
	<[email protected]>
	<CA+TgmoZgj+zJ4C3To0f5=_M+ZJT2Yxa0pO_31Kr7KBhf8wXr6w@mail.gmail.com>
	<[email protected]>
	<CAKFQuwY0CqZdZL3Wq6kM7WEQX+RfFYeNY6_ON_SCJ1vRRbrO=g@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAKFQuwanYpV_0quPhRMpVoyUew4-4to0u1E0uXMNY4=ODPZHWQ@mail.gmail.com>
	<[email protected]>
	<CAKFQuwZXQP7ox0jsa+AqKa-4MkTpd2VypJm9dkXsk+6wKEQ2Gg@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAKFQuwZiomZFLd5zK=feCjY7Weefvce1MR+k38wyBMbaP2ASsg@mail.gmail.com>

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?

  
-----
Pavel Luzanov


Attachments:

  [application/sql] t.sql (3.1K, ../[email protected]/3-t.sql)
  download

view thread (12+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: psql: Add role's membership options to the \du+ command
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox