From: Tom Lane <tgl@sss.pgh.pa.us>
To: myanodress@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18411: Unable to create database with owner on AWS RDS
Date: Wed, 27 Mar 2024 17:00:59 -0400
Message-ID: <3442033.1711573259@sss.pgh.pa.us> (raw)
In-Reply-To: <18411-fdfca450bc4e7dd8@postgresql.org>
References: <18411-fdfca450bc4e7dd8@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> Using the postgres user on AWS RDS, execution of
> CREATE USER my_user WITH PASSWORD 'my-user-password';
> CREATE DATABASE my_database WITH OWNER=my_user;
> Results in an error:
> ERROR: must be able to SET ROLE "my_user"
> SQL state: 42501
> However, the following succeeds
> CREATE USER my_user WITH PASSWORD 'my-user-password';
> CREATE DATABASE my_database;
> ALTER DATABASE my_database OWNER TO my_user;
> Is this intended behaviour or am I taking advantage of a bug by creating the
> database and then setting the OWNER using ALTER DATABASE?
Both things fail for me:
regression=# create user admin with createrole createdb;
CREATE ROLE
regression=# \c - admin
You are now connected to database "regression" as user "admin".
regression=> CREATE USER my_user WITH PASSWORD 'my-user-password';
CREATE ROLE
regression=> CREATE DATABASE my_database WITH OWNER=my_user;
ERROR: must be able to SET ROLE "my_user"
regression=> CREATE DATABASE my_database;
CREATE DATABASE
regression=> ALTER DATABASE my_database OWNER TO my_user;
ERROR: must be able to SET ROLE "my_user"
I suggest taking this up with AWS.
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, myanodress@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18411: Unable to create database with owner on AWS RDS
In-Reply-To: <3442033.1711573259@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