Re: BUG #16374: I can't directly change owner from my created database to my created user. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16374: I can't directly change owner from my created database to my created user.
Date
Msg-id 18975.1587130176@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16374: I can't directly change owner from my created database to my created user.  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
>> **postgres=> alter database db1 owner to user1;**
>> **2020-04-17 16:37:04.328 CST [4712] ERROR:  must be member of role
> "user1"**

> However, "user1" is my created, and "db1" is my created too. Why couldn't I
> chenge owner of "db1" to "user1" directly?

Like it says, you're not a member of role user1.  Since you have
createrole privilege, you could make yourself a member:

regression=> grant user1 to root;
GRANT ROLE

and then it'd work.  But you didn't.  (This is one of the ways that
createrole is less powerful, and less dangerous, than superuser.)

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16374: I can't directly change owner from my created database to my created user.
Next
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: [BUG] non archived WAL removed during production crash recovery