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: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jim Nasby <jim(dot)nasby(at)gmail(dot)com>, Robert Haas <robertmhaas(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-06-06 09:08:48
Message-ID: a76175f6-aa05-4910-b6e0-994037a3f11c@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16.04.2024 09:15, Pavel Luzanov wrote:
> On 16.04.2024 01:06, David G. Johnston wrote:
>> At this point I'm on board with retaining the \dr charter of simply being
>> an easy way to access the detail exposed in pg_roles with some display
>> formatting but without any attempt to convey how the system uses said
>> information.  Without changing pg_roles.  Our level of effort here, and
>> degree of dependence on superuser, doesn't seem to be bothering people
>> enough to push more radical changes here through and we have good
>> improvements that are being held up in the hope of possible perfection.
> I have similar thoughts. I decided to wait for the end of
> featurefreeze and propose a simpler version of the patch for v18,
> without changes in pg_roles

Since no votes for the changes in pg_roles, please look the simplified version.
We can return to this topic later.

Butnowthere are nochangesinpg_roles. Just a special interpretation
of the two values of the "Connection limit" column:
0 - Now allowed (changed from 'No connections')
-1 - empty string

Full list of changes in commit message.

Example output:

\du+ regress_du*
List of roles
Role name | Login | Attributes | Valid until | Connection 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 | Not allowed |
regress_du_role1 | no | Create role+| infinity | |
| | Inherit | | |
regress_du_role2 | yes | Inherit +| | 42 |
| | Replication+| | |
| | Bypass RLS | | |
(4 rows)

Data:
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';

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

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2024-06-06 09:10:05 Remove dependency on VacuumPage(Hit/Miss/Dirty) counters in do_analyze_rel
Previous Message Wang Cheng 2024-06-06 09:04:42 Re: Proposal: Job Scheduler