This topic describes how to create and delete a PolarDB for PostgreSQL database.

Create a database

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where your cluster is deployed.
  3. Find the cluster that you want to manage and click the ID of the cluster.
  4. In the left-side navigation pane, choose Settings and Management > Databases.
  5. Click Create Database. Create a database
  6. In the Create Database panel, configure the following parameters.
    Parameter Description
    Database Name
    • The database name must start with a letter and end with a letter or digit.
    • The database name can contain lowercase letters, digits, underscores (_), and hyphens (-).
    • The database name must be 2 to 64 characters in length.
    • The database name must be unique in a cluster.
    Note The database name cannot be test or another keyword that is reserved by the system.
    Database Owner The owner of the database. The owner is granted all permissions on the database.
    Supported Character Set The character set supported by the database. Default value: UTF8. You can select another required character set from the drop-down list.
    Collate The rule based on which strings are sorted.
    Ctype The type of characters supported by the database.
    Description Enter a description for the database. The description can help you manage your database. The description that you specify must meet the following requirements:
    • The description cannot start with http:// or https://.
    • The description must start with a letter.
    • The description can contain letters, digits, underscores (_), and hyphens (-).
    • The description must be 2 to 256 characters in length.
  7. Click OK.

Delete a database

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where your cluster is deployed.
  3. Find the cluster that you want to manage and click the ID of the cluster.
  4. In the left-side navigation pane, choose Settings and Management > Databases.
  5. Find the database that you want to delete, and click Delete in the Actions column.
  6. In the message that appears, click OK.

Related API operations

API Description
CreateDatabase Creates a database.
DescribeDatabases Views the database list.
ModifyDBDescription Modifies the description of a database.
DeleteDatabase Deletes a database.