user3258784
user3258784

Reputation: 2085

user with CREATEUSER can create database?

Team, I am using Redshift 8.0.2. I created one user as below:

 create user user004 with password 'User123#'  CREATEUSER valid until '2015-03-31';
redshift3=# select * from pg_user where usename = 'user004' ;

 usename | usesysid | usecreatedb | usesuper | usecatupd |  passwd  |        valuntil        | useconfig
---------+----------+-------------+----------+-----------+----------+------------------------+-----------
 user004 |      104 | f           | t        | f         | ******** | 2015-03-31 00:00:00+00 |
(1 row)

I did not grant CREATEDB to this user. However, this user able to create a database.

redshift3=# create database mydb4 ;

CREATE DATABASE

redshift3=# \list
                    List of databases
      name      |  owner  | encoding | access privileges
----------------+---------+----------+-------------------

 mydb4          | user004 | UNICODE  |

In pg_user, property shows false. Please guide me. Is this default behaviour in Redshift ?

Upvotes: 0

Views: 2501

Answers (1)

mike_pdb
mike_pdb

Reputation: 2828

You gave the user the CREATEUSER privilege which makes the user into a superuser and therefore they can do whatever they want. See http://docs.aws.amazon.com/redshift/latest/dg/r_superusers.html for details.

Upvotes: 3

Related Questions