Follow the procedure below to define a database using client commands.
An example of operations on the server is shown below.
Use psql command to connect to the postgres database.
Execute psql postgres.
> psql postgres psql (9.2.8) Type "help" for help.
Create the database.
To create the database, execute the CREATE DATABASE databaseName; statement.
postgres=# CREATE DATABASE db01; CREATE DATABASE
Confirm that the database is created.
Execute the \l+ command, and confirm that the name of the database created in step 2 is displayed.
postgres=# \l+
Disconnect from the postgres database.
Execute \q to terminate the psql command.
postgres=# \q
You can create a database using the createdb command.
See
Refer to "Creating a Database" in the "Tutorial" in the PostgreSQL Documentation for information on creating a database using the createdb command.