CREATE DATABASE
Create a new database. The default database is _system.
Syntax
Parameters
| Parameter | Description |
|---|---|
IF NOT EXISTS | Do not raise an error if a database with the same name already exists |
| database_name | Name 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