pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Floris Van Nee <florisvannee@Optiver.com>
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Error for GRANTED BY in PG16&PG17 that does not happen in PG15
Date: Wed, 12 Feb 2025 10:56:01 +0000
Message-ID: <bc5f945cbd27483f83a59880550722ce@Optiver.com> (raw)

Hi, I observed some difference in behavior for granting roles.

Running as a superuser (postgres).

SQL:
create role test_group;
create role test_user;
create role test_su with superuser;
grant test_group to test_user granted by test_su;

Output on PG16 & PG17:
CREATE ROLE
CREATE ROLE
CREATE ROLE
ERROR:  permission denied to grant privileges as role "test_su"
DETAIL:  The grantor must have the ADMIN option on role "test_group".

The same succeeds on PG15.

This likely has to do with work that was done by Robert Haas on introducing this ADMIN option in PG16.
Surely doing “granted by some_superuser” should be allowed regardless of the ADMIN option though, right?

-Floris



Message-ID: <bc5f945cbd27483f83a59880550722ce@Optiver.com>
Permalink:  ../bc5f945cbd27483f83a59880550722ce@Optiver.com/
Also on:    postgresql.org/message-id/bc5f945cbd27483f83a59880550722ce@Optiver.com

 · 

reply

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-bugs@postgresql.org
  Cc: florisvannee@Optiver.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Error for GRANTED BY in PG16&PG17 that does not happen in PG15
  In-Reply-To: <bc5f945cbd27483f83a59880550722ce@Optiver.com>

* 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