This topic describes how to create a database.

Syntax

CREATE DATABASE name

Parameters

Parameter Description
name The name of the database to be created.

Description

CREATE DATABASE creates a new database.

Note
  • To create a database, you must be a superuser or have the special CREATEDB permissions.
  • Non-superusers with CREATEDB permissions can only create databases owned by them.
  • CREATE DATABASE cannot be executed inside a transaction block.
  • Make sure that the disk space is sufficient when you create a new database.

Examples

CREATE DATABASE testdb;