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

RDS for PostgreSQL

Copy page
Download PDF
Managing databases
CloneDatabase
Copy page
Download PDF
CloneDatabase
Call the CloneDatabase API to clone an existing database.​
Request type​
Asynchronous request.​
Precautions​
  • Only one clone database task can exist under an instance.​
  • A maximum of 2,000 databases can be created under one instance. When the number of database instances has reached 2,000, the database cannot be cloned.​
  • Only databases with no more than 1,000 cloned tables are supported.​
  • During the process of cloning a database, you cannot perform DDL operations on the database.​
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-a3e7eb2f****​
Instance ID.​
SourceDBName​
String​
Yes​
database​
Source database name.​
NewDBName​
String​
No​
database_clone​
Set the name of the new database. The Database name must follow these rules:​
  • The name is unique within the instance.​
  • The name length is limited to 2–63 characters.​
  • The name must start with a letter and end with a letter or a digit.​
  • It consists of letters, digits, underscores (_), or hyphens (-).​
  • Some reserved words or keywords cannot be used in the database name. Refer to Reserved keywords for all reserved keywords.​
tip​
If not set, the new database is named by default with the source database name + _clone_ + timestamp.​
DataOption​
String​
No​
Metadata​
Currently, only cloning the database structure is supported, and the value must be set to Metadata.​
PLPGSQLOption​
String​
No​
View,Procedure​
PL/pgSQL options for cloning a database. Multiple values are allowed, separated by commas (,).​
  • Views: views.​
  • Stored procedures: stored procedures.​
  • Functions: functions.​
  • Triggers: triggers.​
​
Response parameter​
null​
Sample​
Sample request​
​
POST /?Action=CloneDatabase&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-a3e7eb2f****",​
"SourceDBName": "database",​
"NewDBName": "database_clone",​
"DataOption": "Metadata",​
"PLPGSQLOption": "View,Procedure"​
}​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "2025050718082836C31DDC1C9EEA9716A6-2ac462",​
"Action": "CloneDatabase",​
"Version": "2022-01-01",​
"Service": "rds_postgresql",​
"Region": "cn-beijijng"​
},​
"Result": null​
}​
​
Last updated: 2026.03.31 10:45:19