Database management
This topic describes how to create and manage databases in a PolarDB for PostgreSQL cluster.
Create Database
-
Go to the PolarDB console. In the left-side navigation pane of the target cluster, choose .
-
Click Create Database, configure the following parameters, and then click OK to create the database.
Parameter
Description
Database (DB) name
The database name. Must meet the following requirements:
Starts with a letter and ends with a letter or a digit.
Must be 2 to 64 characters in length.
Can contain only lowercase letters, digits, hyphens (
-), and underscores (_).
NoteThe database name must be unique within the cluster.
The database name cannot be changed after creation. Specify it carefully.
Do not use reserved keywords, such as
test, as the database name.
Database Owner
The database owner. The owner has ALL privileges on the database.
View the owner: Check the Owner column on the Databases page of the console.
You can leave this parameter empty and change the database owner after the database is created. For more information, see Change the database owner.
Supported character sets
The character set supported by the database. Default: UTF8. To use a different character set, select one from the drop-down list.
Collate
The string sort order. Default: C. For less common languages, we recommend that you select en_US.utf8.
C type
The character classification. This parameter is determined by the collation setting.
Notes and Remarks
You can add remarks about the database to facilitate subsequent management. Must meet the following requirements:
Cannot start with http:// or https://.
Must be 2 to 256 characters in length.
Can contain uppercase letters, lowercase letters, Chinese characters, digits, underscores (
_), and hyphens (-).
Delete a database
After you delete a database, all data in the database is erased and the database can no longer be accessed. Proceed with caution.
-
Go to the PolarDB console. In the left-side navigation pane of the target cluster, choose .
-
Find the target database and click Operation in the Delete column. In the confirmation dialog, click OK to delete the database.
Change the database owner
-
Go to the PolarDB console. In the left-side navigation pane of the target cluster, choose .
-
Find the target database and click Operation in the Change Owner.
-
In the Change Owner dialog, select a new owner for the database and click OK.
Related APIs
API | Description |
Creates a database in a PolarDB cluster. | |
Deletes a database from a PolarDB cluster. | |
Queries the details of a specified database in a PolarDB cluster. |