Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxJcP-00HZt2-Jl for pgsql-admin@arkaria.postgresql.org; Mon, 30 Oct 2023 04:11:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxJcN-00B0FV-Vf for pgsql-admin@arkaria.postgresql.org; Mon, 30 Oct 2023 04:11:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxJcN-00B0FM-KM for pgsql-admin@lists.postgresql.org; Mon, 30 Oct 2023 04:11:11 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxJcK-002zO8-Nb for pgsql-admin@lists.postgresql.org; Mon, 30 Oct 2023 04:11:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 39U4B6m62311582; Mon, 30 Oct 2023 00:11:06 -0400 From: Tom Lane To: Laurenz Albe cc: Gambhir Singh , pgsql-admin@lists.postgresql.org Subject: Re: Not able to grant role to User. In-reply-to: <7d778cce665a121629d1eb41dde4774adf4d22d0.camel@cybertec.at> References: <7d778cce665a121629d1eb41dde4774adf4d22d0.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Mon, 30 Oct 2023 04:48:13 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2311580.1698639066.1@sss.pgh.pa.us> Date: Mon, 30 Oct 2023 00:11:06 -0400 Message-ID: <2311581.1698639066@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe 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