Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
Right, but is there any way to only allow the user to create a db of a particular name? – Chris Withers Mar 9 at 13:47

Your Answer


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.