Editing Database General

To create a database, you must have the Can create database (usecreatedb) right. Refer to Role Editor or User Editor on how to set user properties.

Database Name
Define the name of the database.

Encoding
Define the encoding for the database. If omitted, the default is the encoding of the template database.

Owner
Define the owner for the database. If omitted, defaults to the user executing the command. Only superusers may create database owned by users other than themselves.

Template
Create the database from a template database.

Note: It is essential that the source database be idle (no data-altering transactions in progress) for the duration of the copying operation. CREATE DATABASE will check that no session (other than itself) is connected to the source database at the start of the operation, but this does not guarantee that changes cannot be made while the copy proceeds, which would result in an inconsistent copied database. Therefore, it is recommended that databases used as templates be treated as read-only.

Tablespace
Define the tablespace for the database. If omitted, defaults to pg_default. See also Tablespaces.