Re: Things I don't like about \du's "Attributes" column - Mailing list pgsql-hackers

From Pavel Luzanov
Subject Re: Things I don't like about \du's "Attributes" column
Date
Msg-id 697ecd9f-aa91-4fa2-ac17-015ddff92687@postgrespro.ru
Whole thread Raw
In response to Re: Things I don't like about \du's "Attributes" column  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
List 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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them
Next
From: shveta malik
Date:
Subject: Re: Conflict detection for update_deleted in logical replication