Re: Not able to grant role to User. - Mailing list pgsql-admin

From Tom Lane
Subject Re: Not able to grant role to User.
Date
Msg-id 2311581.1698639066@sss.pgh.pa.us
Whole thread Raw
In response to Re: Not able to grant role to User.  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-admin
Laurenz Albe <laurenz.albe@cybertec.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



pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Not able to grant role to User.
Next
From: SOzcn
Date:
Subject: Re: On Replica - History issue