CREATE DATABASE
Creates a new database.
Synopsis
CREATE DATABASE name
[ [WITH] [OWNER [=] <user_name>]
[TEMPLATE [=] <template>]
[TABLESPACE [=] <tablespace_name>]
[ALLOW_CONNECTIONS [=] <allowconn>]
[CONNECTION LIMIT [=] <connlimit> ]
[IS_TEMPLATE [=] <istemplate> ] ]
Description
CREATE DATABASE
creates a new database.
To create a database, you must be a superuser or have the special CREATEDB
privilege. See CREATE ROLE
.
The creator becomes the owner of the new database by default. Superusers can create databases owned by other users by using the OWNER
clause. They can even create databases owned by users with no special privileges. Non-superusers with CREATEDB
privilege can only create databases owned by themselves.
By default, the new database will be created by cloning the standard system database template1
. A different template can be specified by writing TEMPLATE name
. In particular, by writing TEMPLATE template0
, you can create a clean database containing only the standard objects predefined by Cloudberry Database. This is useful if you wish to avoid copying any installation-local objects that may have been added to template1
.