Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

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

How do I give a user account in PostgreSQL the ability to create and drop databases? Is there a way to do this with GRANT?

share|improve this question
up vote 81 down vote accepted

It's done with ALTER USER username CREATEDB;

See ALTER USER in the doc.

To drop a database, either you're superuser (which can be granted with ALTER USER too) or you must own the database.

share|improve this answer

First, you have to login as postgres user:

$ sudo -u postgres psql postgres

# \password postgres

Enter new password:

After entering new password for postgres user (special kind of user on PostgreSQL), you are now logged in as postgres and you can grant permission to other users. Let's say you have user named user1. To grant him ability to create and drop databases, you have to write (as postgres user):


Hope this helps...

share|improve this answer

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.