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

From: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
To: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
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-15 09:50:39
Message-ID: CA+FpmFc-26rbbRt1f2dLAAb0DeY7b7Xj7ioOoBd5Ch5uJYq5Eg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 13 Jul 2024 at 14:21, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru> wrote:
>
> 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

Well, it was just my opinion of how I would have liked it better, but
of course you may decide against it, there is no strong feeling around
it.
And if you are on the fence with the opinion of having them in normal
or extended mode, then maybe we can ask more people to chip in.

I certainly would not want you to update the patch back and forth for
almost no reason.
--
Regards,
Rafia Sabih

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-07-15 09:52:28 Re: broken JIT support on Fedora 40
Previous Message Aleksander Alekseev 2024-07-15 08:38:42 Re: gcc 13 warnings