Re: Things I don't like about \du's "Attributes" column

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: Wen Yi <wen-yi(at)qq(dot)com>, "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>, Jim Nasby <jim(dot)nasby(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Things I don't like about \du's "Attributes" column
Date: 2024-04-16 07:06:26
Message-ID: c4d81aef-cb96-4b80-b58b-224d013f8c97@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 14.04.2024 05:02, Wen Yi wrote:
> I think we can change the output like this:
>
> postgres=# \du
> List of roles
> Role name | Login | Attributes | Password | Valid until | Connection limit
> -----------+-------+-------------+----------+-------------+------------------
> test | | Inherit | | |
> test2 | Can | Inherit | Has | |
> wenyi | Can | Superuser +| | |
> | | Create DB +| | |
> | | Create role+| | |
> | | Inherit +| | |
> | | Replication+| | |
> | | Bypass RLS | | |
> (3 rows)
>
> And I submit my the patch, have a look?

Thanks for the patch.

As I understand, your patch is based on my previous version.
The main thing I'm wondering about my patch is if we need to change pg_roles,
and it looks like we don't. So, in the next version of my patch,
the Password column will no longer be there.

As for the Login column and its values.
I'm not sure about using "Can" instead of "yes" to represent true.
In other psql commands, boolean values are always shown as yes/no.
NULL instead of false might be possible, but I'd rather check if this approach
has been used elsewhere. I prefer consistency everywhere.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Fercot 2024-04-16 07:09:55 Re: pg_combinebackup fails on file named INCREMENTAL.*
Previous Message Robins Tharakan 2024-04-16 06:57:41 Re: Why is parula failing?