From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Gambhir Singh <gambhir.singh05@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Not able to grant role to User.
Date: Mon, 30 Oct 2023 00:11:06 -0400
Message-ID: <2311581.1698639066@sss.pgh.pa.us> (raw)
In-Reply-To: <7d778cce665a121629d1eb41dde4774adf4d22d0.camel@cybertec.at>
References: <CAHOGQfWA-ahoQBUoPrHB8mXyHttGPpCsUMKpngd7+5ShAOpZVA@mail.gmail.com>
<7d778cce665a121629d1eb41dde4774adf4d22d0.camel@cybertec.at>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, gambhir.singh05@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Not able to grant role to User.
In-Reply-To: <2311581.1698639066@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox