IF NOT EXISTS | Create a new database only if a database of the same name does not already exist; if one does exist, do not return an error. |
name | The name of the database to create, which must be unique and follow these identifier rules. Cockroach Labs recommends against starting your database name with the string cluster:. If your database name begins with this string, you must append the following to the URI connection string to connect to the cluster: &options=-ccluster=system |
encoding | The CREATE DATABASE statement accepts an optional ENCODING clause for compatibility with PostgreSQL, but UTF-8 is the only supported encoding. The aliases UTF8 and UNICODE are also accepted. Values should be enclosed in single quotes and are case-insensitive. Example: CREATE DATABASE bank ENCODING = 'UTF-8'. |
CONNECTION LIMIT | Supported for compatibility with PostgreSQL. A value of -1 indicates no connection limit. Values other than -1 are currently not supported. By default, CONNECTION LIMIT = -1. (*) |
PRIMARY REGION region_name | Create a multi-region database with region_name as the primary region. Allowed values include any region returned by SHOW REGIONS FROM CLUSTER. |
REGIONS region_name_list | Create a multi-region database with region_name_list as database regions. Allowed values include any region returned by SHOW REGIONS FROM CLUSTER. To set database regions at database creation, a primary region must be specified in the same CREATE DATABASE statement. |
SURVIVE ZONE FAILURE (Default) SURVIVE REGION FAILURE | Create a multi-region database with regional failure or zone failure survival goals. To set the regional failure survival goal, the database must have at least 3 database regions. Surviving zone failures is the default setting for multi-region databases. |