Re: BUG #16374: I can't directly change owner from my created database to my created user.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: 369358123(at)qq(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16374: I can't directly change owner from my created database to my created user.
Date: 2020-04-17 13:29:36
Message-ID: 18975.1587130176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

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