You can call the DescribeUpgradeMajorVersionPrecheckTask operation to query the check report for a major engine version upgrade to an ApsaraDB RDS for PostgreSQL instance.

Before you upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance, you must perform an upgrade check and make sure that the check result is Success. You can call this operation to query the upgrade check report.

If the check result is Fail, you must handle the errors that occurred. For more information about how to handle common errors, see Introduction to the check report for a major engine version upgrade to 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 DescribeUpgradeMajorVersionPrecheckTask

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

DBInstanceId String Yes pgm-bp1c808s731l****

The ID of the instance.

PageSize Integer No 30

The number of entries to return on each page of the upgrade check report.

Valid values:

  • 30. This is the default value.
  • 50.
  • 100.
PageNumber Integer No 1

The number of the page to return in the upgrade check report.

Valid values: any non-zero positive integer. Default value: 1.

TargetMajorVersion String No 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.0, the new major engine version can be PostgreSQL 11, PostgreSQL 12, PostgreSQL 13, PostgreSQL 14, or PostgreSQL 15.

TaskId Integer No 416980000

The ID of the upgrade check task. You can obtain the ID of the upgrade check task from the TaskId parameter that is returned from the call of the UpgradeDBInstanceMajorVersionPrecheck operation.

Response parameters

Parameter Type Example Description
RequestId String D1586777-41B5-5F9E-81E8-93DFDD379024

The ID of the request.

PageNumber Integer 1

The number of the returned page.

PageRecordCount Integer 30

The number of entries returned per page.

TotalRecordCount Integer 1

The total number of entries in the upgrade check report.

Items Array of Tasks

An array that consists of the attributes in the upgrade check report.

TargetMajorVersion String 12.0

The new major engine version of the instance.

EffectiveTime String 1635748703000

The expiration time of the upgrade check report.

The value of this parameter is a timestamp that follows the UNIX time format. Unit: milliseconds.

SourceMajorVersion String 11.0

The original major engine version of the instance.

Result String Success

The result of the upgrade check.

Valid values:

  • Success
  • Fail
Note If the check result is Fail, you must check the value of the Detail parameter to obtain the information about the errors that occurred. After you handle the errors, you can try again. For more information about how to handle common errors, see Introduction to the check report for a major engine version upgrade to an ApsaraDB RDS for PostgreSQL instance.
TaskId Integer 416980000

The ID of the upgrade check task.

Detail String [user_check_report]User check success\n[pg_upgrade_internal.log]Performing...

The content of the upgrade check report.

CheckTime String 1635143903000

The time at which the upgrade check was performed.

The value of this parameter is a timestamp that follows the UNIX time format. Unit: milliseconds.

Examples

Sample requests

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

Sample success responses

XML format

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

<DescribeUpgradeMajorVersionPrecheckTask>
    <TotalRecordCount>1</TotalRecordCount>
    <PageRecordCount>30</PageRecordCount>
    <RequestId>D1586777-41B5-5F9E-81E8-93DFDD379024</RequestId>
    <PageNumber>1</PageNumber>
    <Items>
        <CheckTime>1635143903000</CheckTime>
        <SourceMajorVersion>11.0</SourceMajorVersion>
        <TaskId>416980000</TaskId>
        <EffectiveTime>1635748703000</EffectiveTime>
        <TargetMajorVersion>12.0</TargetMajorVersion>
        <Detail>[user_check_report]User check success\n[pg_upgrade_internal.log]Performing...</Detail>
        <Result>Success</Result>
    </Items>
</DescribeUpgradeMajorVersionPrecheckTask>

JSON format

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

{
  "TotalRecordCount" : 1,
  "PageRecordCount" : 30,
  "RequestId" : "D1586777-41B5-5F9E-81E8-93DFDD379024",
  "PageNumber" : 1,
  "Items" : {
    "CheckTime" : 1635143903000,
    "SourceMajorVersion" : 11.0,
    "TaskId" : 416980000,
    "EffectiveTime" : 1635748703000,
    "TargetMajorVersion" : 12.0,
    "Detail" : "[user_check_report]User check success\\n[pg_upgrade_internal.log]Performing...",
    "Result" : "Success"
  }
}

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, see Service error codes.