Skip to main content

CREATE DATABASE

Create a new database. The default database is _system.

Syntax

Parameters

ParameterDescription
IF NOT EXISTSDo not raise an error if a database with the same name already exists
database_nameName of the database to create

Examples

Create a database

CREATE DATABASE IF NOT EXISTS app_production;

Connect to the new database:

psql -h localhost -p 7890 -d app_production

See also