From: Tom Lane <tgl@sss.pgh.pa.us>
To: 369358123@qq.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16374: I can't directly change owner from my created database to my created user.
Date: Fri, 17 Apr 2020 09:29:36 -0400
Message-ID: <18975.1587130176@sss.pgh.pa.us> (raw)
In-Reply-To: <16374-7ef684e3fe909b74@postgresql.org>
References: <16374-7ef684e3fe909b74@postgresql.org>
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
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: tgl@sss.pgh.pa.us, 369358123@qq.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16374: I can't directly change owner from my created database to my created user.
In-Reply-To: <18975.1587130176@sss.pgh.pa.us>
* 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