Re: BUG #18411: Unable to create database with owner on AWS RDS

From: Andrey Lizenko <lizenko79(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: myanodress(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18411: Unable to create database with owner on AWS RDS
Date: 2024-03-28 01:25:47
Message-ID: CADKuZZBYUh_tyMgDBwDF=WAu+T5uGX4QtNFS3EnuFao9qbEVgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

AWS uses role rdsadmin for tasks like this with limited default permissions
for other roles.

On Wed, 27 Mar 2024 at 22:01, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

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

--
Regards, Andrei Lizenko

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2024-03-28 01:45:24 Re: BUG #18411: Unable to create database with owner on AWS RDS
Previous Message Tom Lane 2024-03-27 21:00:59 Re: BUG #18411: Unable to create database with owner on AWS RDS