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 upgrade the instance to the new major engine version.

ApsaraDB RDS for PostgreSQL provides the major engine 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 causes 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 the description in Upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.

Debugging

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 14, PostgreSQL 13, PostgreSQL 12, PostgreSQL 11, or PostgreSQL 10, or PostgreSQL 9.4.
  • The instance runs RDS High-availability Edition or RDS Basic Edition.
  • The RDS instance must reside in a virtual private cloud (VPC). If the original 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.
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 10, the new major engine version can be PostgreSQL 11, PostgreSQL 12, PostgreSQL 13, PostgreSQL 14, or PostgreSQL 15.

Response parameters

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

The name of the instance.

TargetMajorVersion String 12.0

The new major engine version of the instance.

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

The ID of the request.

TaskId String 41698****

The ID of the task.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=UpgradeDBInstanceMajorVersionPrecheck
&DBInstanceId=pgm-bp1c808s731l****
&TargetMajorVersion=12.0
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpgradeDBInstanceMajorVersionPrecheck>
    <TaskId>41698****</TaskId>
    <RequestId>99C1FEEE-FB44-5342-8EBA-DC1E1A1557A4</RequestId>
    <TargetMajorVersion>12.0</TargetMajorVersion>
    <DBInstanceName>pgm-bp1c808s731l****</DBInstanceName>
</UpgradeDBInstanceMajorVersionPrecheck>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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.
400 InvalidDBInstanceEngineType.Format the DB instance engine type does not support this operation. The error message returned because the operation is not supported by the database engine of the instance.
403 ParamNotFound The parameter is not found for the interface. The error message returned because the parameter is not found.

For a list of error codes, see Service error codes.