Why no pg_has_role(..., 'ADMIN')?

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: robertmhaas(at)gmail(dot)com
Subject: Why no pg_has_role(..., 'ADMIN')?
Date: 2024-09-20 15:26:10
Message-ID: CAFCRh-8JNEy+dV4SXFOrWca50u+d=--TO4cq=+ac1oBtfJy4AA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Thanks for any insights. --DD

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2024-09-20 16:37:49 Re: Why no pg_has_role(..., 'ADMIN')?
Previous Message Ron Johnson 2024-09-20 13:37:23 Re: Dependencies on the system view