Create a database

To create a database, use the CREATE DATABASE command.

For example:
MYDB.SCHEMA(USER)=> CREATE DATABASE mydb;
CREATE DATABASE
If you do not have the privileges that are required to create a database, the system displays the following message:
ERROR:  CREATE DATABASE: permission denied.

Database names can have a maximum length of 128 bytes, otherwise the system displays an error message. Database names must be valid identifier names.

When you create a database, the system automatically creates three schemas: an INFORMATION_SCHEMA, a DEFINITION_SCHEMA, and a schema with a name that matches the owner of the database. INFORMATION_SCHEMA and DEFINITION_SCHEMA are used by the system to hold information about system objects and views, but they are not accessible by users. The owner schema is the default schema.

For systems that are configured to support multiple schemas, any user who is granted access to the database inherits access to the default schema, unless the system is configured with the setting enable_user_schema = TRUE. In that case, users who are granted access to the database are connected to a schema name that matches their user name.