Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.