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

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jim Nasby <jim(dot)nasby(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Things I don't like about \du's "Attributes" column
Date: 2025-06-24 10:02:04
Message-ID: 697ecd9f-aa91-4fa2-ac17-015ddff92687@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 11.04.2025 20:09, David G. Johnston wrote:
>> However, I do think we are at something committable, though I'd make
>> one, maybe two, changes to v8.

Let's return to this topic.

>> Valid until -> Password valid until: the timestamp value already
>> forces a wide column, adding the word Password to the header to
>> clarify what is valid simply provides the same context that the
>> create role page provides when it shows the valid until attribute
>> immediately below the password attribute.  Leaving "valid until"
>> alone retains the attribute name tieback.
>>
>> Connection limit -> Con. limit: maybe this gets rejected on
>> translation grounds but the abbreviation here seems obvious and
>> shaves 7 characters off the mandatory width for a column that
>> occupies 12 characters more than the values require.

Both changes implemented in v9.

Example output from regression test:

CREATE ROLE regress_du_role0 LOGIN PASSWORD '123' VALID UNTIL
'2024-06-04' CONNECTION LIMIT 0;
CREATE ROLE regress_du_role1 CREATEROLE CONNECTION LIMIT -1 VALID UNTIL
'infinity';
CREATE ROLE regress_du_role2 LOGIN REPLICATION BYPASSRLS CONNECTION
LIMIT 42;
CREATE ROLE regress_du_admin LOGIN SUPERUSER CREATEROLE CREATEDB
BYPASSRLS REPLICATION INHERIT;
COMMENT ON ROLE regress_du_admin IS 'some description';

\du+ regress_du*
                                             List of roles
    Role name     | Login | Attributes  |     Password valid until    
| Con. limit |   Description
------------------+-------+-------------+------------------------------+------------+------------------
 regress_du_admin | yes   | Superuser +|                             
|            | some description
                  |       | Create DB +|                             
|            |
                  |       | Create role+|                             
|            |
                  |       | Inherit +|                             
|            |
                  |       | Replication+|                             
|            |
                  |       | Bypass RLS |                             
|            |
 regress_du_role0 | yes   | Inherit     | Tue Jun 04 00:00:00 2024 PDT
|          0 |
 regress_du_role1 | no    | Create role+| infinity                    
|            |
                  |       | Inherit |                             
|            |
 regress_du_role2 | yes   | Inherit +|                             
|         42 |
                  |       | Replication+|                             
|            |
                  |       | Bypass RLS |                             
|            |
(4 rows)

I marked commitfest entry[1] as Need Review.

1. https://commitfest.postgresql.org/patch/4738/

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

Attachment Content-Type Size
v9-0001-psql-Rethinking-of-du-command.patch text/x-patch 11.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-06-24 10:20:37 Re: Logrep launcher race conditions leading to slow tests
Previous Message Peter Eisentraut 2025-06-24 09:42:46 Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them