You can call the UpgradeDBInstanceMajorVersionPrecheck operation to check the compatibility between a new major engine version and an ApsaraDB RDS for PostgreSQL instance before you perform an upgrade to the new major engine version.

ApsaraDB RDS for PostgreSQL provides the major version upgrade feature. You can use this feature to upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.

Before you perform an upgrade, you must perform an upgrade check and make sure that the check result is Success. You can call this operation to perform an upgrade check.

An upgrade brings impacts, such as a transient connection that lasts a few minutes. We recommend that you perform an upgrade during off-peak hours. Before you perform an upgrade, we recommend that you read Upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpgradeDBInstanceMajorVersionPrecheck

The operation that you want to perform. Set the value to UpgradeDBInstanceMajorVersionPrecheck.

DBInstanceId String Yes pgm-bp1c808s731l****

The ID of the instance.

The instance must meet the following requirements:

  • The instance runs PostgreSQL 12, PostgreSQL 11, PostgreSQL 10, or PostgreSQL 9.4.
  • The instance runs RDS High-availability Edition or RDS Basic Edition.
  • The instance resides in a virtual private cloud (VPC). If the instance resides in the classic network, you must migrate the instance to a VPC before you call this operation. For more information about how to view or change the network type of an instance, see Change the network type of an ApsaraDB RDS for PostgreSQL instance.
  • The instance cannot be a read-only instance and cannot be created in a dedicated cluster.
  • The ID of the instance does not start with pg-cn.
TargetMajorVersion String Yes 12.0

The new major engine version of the instance. The new major engine version must be later than the original major engine version.

For example, if the original major engine version is PostgreSQL 9.4, the new major engine version can be PostgreSQL 10, PostgreSQL 11, PostgreSQL 12, or PostgreSQL 13.

Response parameters

Parameter Type Example Description
DBInstanceName String pgm-bp1c808s731l****

The name of the instance.

RequestId String 99C1FEEE-FB44-5342-8EBA-DC1E1A1557A4

The ID of the request.

TargetMajorVersion String 12.0

The new major engine version of the instance.

TaskId String 41698****

The ID of the upgrade check task.


Sample requests

&<Common request parameters>

Sample success responses

XML format


JSON format

    "TaskId": "41698****",
    "RequestId": "99C1FEEE-FB44-5342-8EBA-DC1E1A1557A4",
    "TargetMajorVersion": 12.0,
    "DBInstanceName": "pgm-bp1c808s731l****"

Error codes

Http status code Error code Error message Description
400 InvalidDBInstanceName.NotFound The specified DB instance name does not exist. The error message returned because the name of the instance cannot be found.

For a list of error codes, visit the API Error Center.