Skip to main content

CREATE DATABASE

Use the CREATE DATABASE command to create a new database.

Syntax

CREATE DATABASE [ IF NOT EXISTS ] database_name
[ WITH ] [ OWNER [=] user_name ];

Parameters

Parameter or clauseDescription
database_nameThe name of the database to be created.
IF NOT EXISTS clauseCreates a database if the database name has not already been used. Otherwise throws an error.
OWNER [=] user_name clauseSpecifies which user owns the database to be created.

Example

CREATE DATABASE IF NOT EXISTS travel
WITH OWNER = travel_admin;
note

Names and unquoted identifiers are case-insensitive. Therefore, you must double-quote any of these fields for them to be case-sensitive. See also Identifiers.

Help us make this doc better!