Re: BUG #17346: pg_upgrade fails with role granted by other role - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17346: pg_upgrade fails with role granted by other role
Date
Msg-id 1489048.1640620947@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17346: pg_upgrade fails with role granted by other role  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17346: pg_upgrade fails with role granted by other role
Re: BUG #17346: pg_upgrade fails with role granted by other role
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> After the commit:

> commit 371087d006e04991080bf17cf2287db38d3ea92e
> Author: Daniel Gustafsson <dgustafsson@postgresql.org>
> Date:   Fri Nov 26 14:02:01 2021 +0100
>     Fix GRANTED BY support in REVOKE ROLE statements

> pg_upgrade for example from 10.19 version causes the error:

Yeah, you don't even need pg_upgrade.  Just do

regression=# CREATE ROLE user1; CREATE ROLE user2; GRANT user1 TO user2 GRANTED BY user1;
CREATE ROLE
CREATE ROLE
ERROR:  grantor must be current user

A superuser, or really anyone who's a member of the user1 role,
ought to be able to do that (especially since it used to be allowed).
So it seems the permissions check was coded incorrectly.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17346: pg_upgrade fails with role granted by other role
Next
From: Daniel Gustafsson
Date:
Subject: Re: BUG #17346: pg_upgrade fails with role granted by other role