October 2014
Intermediate to advanced
142 pages
3h 9m
English
The next logical step is to create a new database. For this operation, PostgreSQL provides an instruction called CREATE DATABASE. Here is the syntax of this vital command:
postgres=# \h CREATE DATABASE Command: CREATE DATABASE Description: create a new database Syntax: CREATE DATABASE name [ [ WITH ] [ OWNER [=] user_name ] [ TEMPLATE [=] template ] [ ENCODING [=] encoding ] [ LC_COLLATE [=] lc_collate ] [ LC_CTYPE [=] lc_ctype ] [ TABLESPACE [=] tablespace_name ] [ CONNECTION LIMIT [=] connlimit ] ]
The \h command is very convenient to use; it provides you with the syntax of basically every command in the system. In short, \h makes life really easy.
In our case, we can see which options CREATE DATABASE provides. First, ...