Re: Things I don't like about \du's "Attributes" column
Pavel Luzanov <p.luzanov@postgrespro.ru>
From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Rafia Sabih <rafia.pghackers@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Jim Nasby <jim.nasby@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-06-24T10:02:04Z
Lists: pgsql-hackers
Attachments
- v9-0001-psql-Rethinking-of-du-command.patch (text/x-patch) patch v9-0001
> 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