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

According to the documentation, so long as I'm not connected to a database, I can either delete a database in the console using:


Or I can drop it using the wrapper tool dropdb.

Both give me an error saying the database doesn't exist, yet when in the console and typing the command \l, I get a list of databases including the one I want to delete.

                                          List of databases
           Name            |   Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
 Blog_development          | myusername | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 Blog_test                 | myusername | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 

The database name is Blog_development (and the one below it). I was playing with rails and trying to learn from the online documentation. I wanted to start over and delete everything.

When trying to delete it however, it says it doesn't exist. I'm brand new to PostgreSQL so I'm a bit lost, nothing in the documentation about this error other than it popping up when it doesn't exist. Of course it exists, it's right there.

share|improve this question
Please always show the full, exact text of any error messages, and show your PostgreSQL version. – Craig Ringer Dec 27 '12 at 2:34
Check the port your DB is running on. The tools such as dropdb, createdb etc will connect by default to 5432. This caught me out when my DB was actually running on 5433. – user35738 Mar 17 '14 at 11:32
up vote 15 down vote accepted

Your database was created using double quotes so its name is now case-sensitive. Therefore, you now need to always use double quotes when referring to it:

drop database "Blog_test";

More details about quoted identifiers (a database name is an identifier just like a column or table name) can be found in the manual:

share|improve this answer
Wooohoo! Thanks. – Sephethus Dec 27 '12 at 15:03
my rule of thumb always use lower case :( I had this same problem. – chrishough Oct 19 '13 at 21:09

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.