I am working with a fresh postgresql install, with ‘postgres’ super user. Logged in via:
sudo -u postgres psql
postgres=# createdb database
postgres-# \list
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
template0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres
: postgres=CTc/postgres
template1 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres
: postgres=CTc/postgres
No errors, yet table is not being created. Any ideas?
createdbis a command line utility which you can run from bash and not from psql.To create a database from psql, use the
create databasestatement like so:Note: be sure to always end your SQL statements with
;