Re: Not able to grant role to User.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Gambhir Singh <gambhir(dot)singh05(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Not able to grant role to User.
Date: 2023-10-30 04:11:06
Message-ID: 2311581.1698639066@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> On Sun, 2023-10-29 at 20:40 +0530, Gambhir Singh wrote:
>> Error: Exception: must have admin option role "application_role"

> This is not a PostgreSQL error message.

It could be a sloppily transcribed version of our pre-v16 message:

if (!have_createrole_privilege() &&
!is_admin_of_role(grantorId, roleid))
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must have admin option on role \"%s\"",
rolename)));

If that's what it is though, any effort at reading the documentation
would have turned up the relevant point: the would-be grantor needs
to have been granted the role WITH ADMIN OPTION in order to be able
to grant it to (or revoke it from) someone else. Or else be
superuser or someone with CREATEROLE.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message SOzcn 2023-10-30 10:48:20 Re: On Replica - History issue
Previous Message Laurenz Albe 2023-10-30 03:48:13 Re: Not able to grant role to User.