Re: psql: Add role's membership options to the \du+ command - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: psql: Add role's membership options to the \du+ command
Date
Msg-id CAKFQuwb6u62n=eq2ZXq6mbVTpqWR2bz_QhmLjWrQ89Kcoi5x+g@mail.gmail.com
Whole thread Raw
In response to Re: psql: Add role's membership options to the \du+ command  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Responses Re: psql: Add role's membership options to the \du+ command  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: psql: Add role's membership options to the \du+ command  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
List pgsql-hackers
On Mon, Mar 6, 2023 at 12:43 AM Pavel Luzanov <p.luzanov@postgrespro.ru> wrote:
Indeed, adding ADMIN to pg_has_role looks logical. The function will show whether one role can manage another directly or indirectly (via SET ROLE).

FWIW I've finally gotten to publishing my beta version of the Role Graph for PostgreSQL pseudo-extension I'd been talking about:


The administration column basically determines all this via a recursive CTE.  I'm pondering how to incorporate some of this core material into it now for both cross-validation purposes and ease-of-use.

I handle EMPTY explicitly in the Role Graph but as I noted somewhere in my comments, it really shouldn't be possible to leave the database in that state.  Do we need to bug Robert on this directly or do you plan to have a go at it?

Adding ADMIN will lead to the question of naming other values. It is more reasonable to have INHERIT instead of USAGE. 
And it is not very clear whether (except for backward compatibility) a separate MEMBER value is needed at all.

There is an appeal to breaking things thoroughly here and removing both MEMBER and USAGE terms while adding ADMIN, SET, INHERIT.

However, I am against that.  Most everyday usage of this would only likely care about SET and INHERIT even going forward - administration of roles is distinct from how those roles generally behave at runtime.  Breaking the later because we improved upon the former doesn't seem defensible.  Thus, while adding ADMIN makes sense, keeping MEMBER (a.k.a., SET) and USAGE (a.k.a., INHERIT) is my suggested way forward.

I'll be looking over your v3 patch sometime this week, if not today.

David J.

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: add PROCESS_MAIN to VACUUM
Next
From: David Rowley
Date:
Subject: Re: Add support for unit "B" to pg_size_pretty()