You need to enable JavaScript to run this app.
RDS for PostgreSQL

RDS for PostgreSQL

Copy page
Download PDF
Managing databases
CreateDatabase
Copy page
Download PDF
CreateDatabase
Call the CreateDatabase API to create a database.​
Request type​
Synchronous request.​
Debug​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
​
Parameter​
Type​
Required?​
Example​
Description​
InstanceId​
String​
Yes​
postgres-ca7b7019****​
Instance ID. You can call the DescribeDBInstances API to query a list of instances.​
DBName​
String​
Yes​
testdb1​
Database name. Naming rules are as follows:​
  • The name length is limited to 2–32 characters.​
  • It consists of letters, digits, underscores, or hyphens.​
  • The name must start with a letter and end with a letter or a digit.​
  • Reserved words cannot be used. For the list of all disabled keywords, refer to Disabled keywords.​
CharacterSetName​
String​
No​
utf8​
Database character set. Currently supported character sets include utf8 (default), latin1, and ascii.​
Collate​
String​
No​
en_US.utf8​
Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.​
Owner​
String​
No​
testuser​
Database owner.​
tip​
  • Instance read-only accounts, super accounts or normal accounts with DDL privileges disabled cannot be used as database owners.​
  • If no value or an empty value is provided, the field takes the value rds superuser.​
CType​
String​
No​
en_US.utf8​
Character category. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.​
​
Response parameter​
null​
Sample​
Sample request​
​
POST /?Action=CreateDatabase&Version=2022-01-01 HTTP/1.1​
Content-Type: application/json​
Host: rds-postgresql.cn-beijing.volcengineapi.com​
X-Date: 20231002T101010Z​
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_postgresql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****​
{​
"InstanceId": "postgres-ca7b7019****",​
"DBName": "testdb1",​
"CharacterSetName": "utf8",​
"Collate": "en_US.utf8",​
"CType": "en_US.utf8"​
}​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "2023080216495255289C8C837799FC33DD",​
"Action": "CreateDatabase",​
"Version": "2022-01-01",​
"Service": "rds_postgresql",​
"Region": "cn-beijing"​
},​
"Result": null​
}​
​
Last updated: 2026.03.31 10:45:18