Syntax
CREATE DATABASE [IF NOT EXISTS] database_name [COLLATE codepage_number]
Description
Creates a new, empty database named database_name in the current cluster. If IF NOT EXISTS is specified, no error will be raised if the database already exists.
If COLLATE is specified, codepage_number specifies the codepage of the locale used for the new database. This is used for:
Code pages
Supported code pages:
|
Number |
Name |
|
1250 |
Eastern European/Latin (default) |
|
1251 |
Cyrillic |
Examples
Create a database with a Cyrillic codepage
CREATE DATABASE example1251 CODEPAGE 1251;
Ensure a database exists without causing an error
CREATE DATABASE IF NOT EXISTS example;
Related