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

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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>
Subject: Re: psql: Add role's membership options to the \du+ command
Date: 2023-04-05 07:42:19
Message-ID: e1ae2192-ed86-ba1b-95c0-063000db62cf@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04.04.2023 22:02, David G. Johnston wrote:
> On Tue, Apr 4, 2023 at 10:37 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Tue, Apr 4, 2023 at 1:12 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> I wonder if, while we're here, we should apply the idea of
> >> joining-with-newlines-not-commas to the attributes column too.
>
> > That would make the column narrower, which might be good, because it
> > seems to me that listing the memberships could require quite a
> lot of
> > space, both vertical and horizontal.
>
> Right, that's what I was thinking.
>
>
> So, by way of example:
>
> regress_du_role1 | cannot login | regress_du_role0 granted by
> regress_du_admin with admin, inherit, set | Description for
> regress_du_role1

Perhaps more closely to syntax?

regress_du_role0 with admin, inherit, set granted by regress_du_admin

instead of

regress_du_role0 granted by regress_du_admin with admin, inherit, set

> No translations, all words are either identical to syntax or identifiers.
>
> I'm on board with newlines in the attributes field.

+1

> The specific member of column changes are:
>
> from -> granted by
> ( ) -> "with"
> ais -> admin, inherit, set
>
> I'm good with any or all of those selections, either as-is or in the
> more verbose form.

From yesterday's discussion, I think two things are important:
- it is advisable to avoid translation,
- there is no sense in the abbreviation (a,i,s), if there are full names
in the 'attributes' column.

So I agree with such changes and plan to implement them.

And one more question. (I think it's better to have it explicitly
rejected than to keep silent.)

What if this long output will be available only for \du+, and for \du
just show distinct (without duplicates)
roles in the current array format? For those, who don't care about these
new membership options, nothing will change.
Those, who need details will use the + modifier.
?

--
Pavel Luzanov
Postgres Professional:https://postgrespro.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-04-05 07:47:25 Re: Add index scan progress to pg_stat_progress_vacuum
Previous Message Peter Eisentraut 2023-04-05 07:33:25 Re: Move defaults toward ICU in 16?