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

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(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: 2024-07-13 12:21:05
Message-ID: 6b53b219-6898-43dc-b04b-262063a1c8e8@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12.07.2024 12:22, Rafia Sabih wrote:
> Other thoughts came to my mind, should we have this column in \du+
> instead, maybe connection limit too.
> I know in the current version we have all this in \du itself, but then
> all clubbed in one column. But now since
> our table has got wider, it might be aesthetic to have it in the
> extended version. Also, their usage wise might not
> be the first thing to be looked at for a user/role.

In the first version of the patch, "Valid until" (named "Password expire time")
and "Connection limit" ("Max connections") columns were in extended mode. [1]

Later we decided to place each attribute in the "Attributes" column on a separate
line. This allowed us to significantly reduce the overall width of the output.
So, I decided to move "Valid until" and "Connection limit" from extended mode
to normal mode.

Just compare output from patched \du and popular \list command:

postgres(at)demo(17.0)=# \du
List of roles
Role name | Login | Attributes | Valid until | Connection limit
-----------+-------+-------------+------------------------+------------------
alice | yes | Inherit | 2024-06-30 00:00:00+03 |
bob | yes | Inherit | infinity |
charlie | yes | Inherit | | 11
postgres | yes | Superuser +| |
| | Create DB +| |
| | Create role+| |
| | Inherit +| |
| | Replication+| |
| | Bypass RLS | |
(4 rows)

postgres(at)demo(17.0)=# \list
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+-------------+-------------+--------+-----------+-----------------------
demo | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | |
postgres | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | |
template0 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
(4 rows)

If we decide to move "Valid until" and "Connection limit" to extended mode,
then the role attributes should be returned to their previous form by placing
them on one line separated by commas.

1.https://www.postgresql.org/message-id/27f87cb9-229b-478b-81b2-157f94239d55%40postgrespro.ru

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Koshakow 2024-07-13 14:24:16 Re: Remove dependence on integer wrapping
Previous Message Zhijie Hou (Fujitsu) 2024-07-13 10:48:55 RE: Slow catchup of 2PC (twophase) transactions on replica in LR