5

When I try to create a db in postgres 9.3, it does not create the database. I do not get any error messages.

abramhandler-# createdb orleansgis
abramhandler-# \list
                                         List of databases
     Name     |    Owner     | Encoding |   Collate   |    Ctype    |       Access privileges       
--------------+--------------+----------+-------------+-------------+-------------------------------
 abramhandler | abramhandler | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres     | abramhandler | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0    | abramhandler | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/abramhandler              +
              |              |          |             |             | abramhandler=CTc/abramhandler
 template1    | abramhandler | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/abramhandler              +
              |              |          |             |             | abramhandler=CTc/abramhandler
(4 rows)

abramhandler-# 

I tried entering #commit and it still does not show the database.

The docs show how to debug error messages -- but I'm not sure what to do when I get no error message at all. It simply does not create the database.

1
  • 3
    SQL statements in psql need to be terminated with a ; - but createdb is not a SQL command it's a commandline program. From within psql you would need to run create database orleansgis; (don't forget the ;) Commented Mar 26, 2014 at 13:26

1 Answer 1

12

createdb is a shell command line command. At the psql client prompt use the create database command

When the prompt is -# it is still waiting for the command termination, a semicolon. Enter Ctrl C to escape that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.