Late side, but the accepted answer does not explain why the error is not displayed. And since this is something that Postgres newbies often stumble over, I would like to add this.
TL / TR: always end your SQL statements with ;
Since createdb database does not end with ; psql , it is believed that the statement is not completed and is waiting for more input. This is indicated by a prompt that changes from postgres=# to postgres-# . The extremely subtle change I want psql will be different (more "noticeable").
By entering the \list meta-command, the "current" SQL statement is "interrupted" without executing it.
If createdb done with ; The output would be:
postgres => createdb foobar;
ERROR: syntax error at or near "createdb"
LINE 1: createdb foobar;
^
postgres => Obviously, something is wrong.
a_horse_with_no_name Dec 08 '15 at 3:19 2015-12-08 15:19
source share