9

I have a PostgreSQL user named mydb_user who has been granted ownership of mydb_dev. mydb_user already has the privilege to drop the database, but I want him to be able to create the database again after deleting it. If possible, I'd like him to only be able to create a database with the same name (mydb_dev) again, but if necessary, I will settle for letting him create a database with any name.

1 Answer 1

6

You want to grant the user role the CREATEDB privilege.
The ability to drop the database is automatically granted to the DB owner, however you must have the CREATEDB privilege to create new databases -- Note that this allows the user to create a database with any name...

1
  • 2
    Right, but is there any way to only allow the user to create a db of a particular name? Commented Mar 9, 2016 at 13:47

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.