Re: Why no pg_has_role(..., 'ADMIN')? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Why no pg_has_role(..., 'ADMIN')?
Date
Msg-id 42cf78d42a376bf05ca9f5776ad29edc30e784d5.camel@cybertec.at
Whole thread Raw
In response to Why no pg_has_role(..., 'ADMIN')?  (Dominique Devienne <ddevienne@gmail.com>)
Responses Re: Why no pg_has_role(..., 'ADMIN')?
List pgsql-general
On Fri, 2024-09-20 at 17:26 +0200, Dominique Devienne wrote:
> To find out whether a ROLE can DROP another in v16+.
> Prior to v16, just having CREATEROLE was enough,
> so it didn't really seem necessary.
>
> But knowing whether DROP ROLE will work,
> w/o invalidating the current transaction,
> seems like something quite useful to know now, no?
>
> I can query pg_auth_members for admin_option,
> but only easily for direct membership. Taking into
> account indirect membership, which I assume applies,
> is exactly why pg_has_role() exists, no?

That would be a useful addition, yes.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Why no pg_has_role(..., 'ADMIN')?
Next
From: Robert Haas
Date:
Subject: Re: Why no pg_has_role(..., 'ADMIN')?