Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Upgrading a Major Version (RDS for PostgreSQL)/ Querying the Major Version Upgrade History of a DB Instance (RDS for PostgreSQL)
Updated on 2026-02-04 GMT+08:00

Querying the Major Version Upgrade History of a DB Instance (RDS for PostgreSQL)

Function

This API is used to query the major version upgrade history.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

rds:instance:listAll

read

-

-

rds:instance:list

-

Constraints

  • This API is available to RDS for PostgreSQL only.
  • This operation cannot be performed when the DB instance is in any of the following statuses: creating, changing instance specifications, changing port, frozen, or abnormal.

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/major-version/upgrade-histories?offset={offset}&limit={limit}&order={order}&sort_field={sort_field}

  • Parameter description
    Table 1 Parameters

    Parameter

    Type

    Mandatory

    Description

    project_id

    String

    Yes

    Definition

    Project ID of a tenant in a region.

    Constraints

    The value cannot be empty.

    Range

    To obtain the value, see Obtaining a Project ID.

    Default Value

    N/A

    instance_id

    String

    Yes

    Definition

    Instance ID.

    Constraints

    The value cannot be empty.

    Range

    You can obtain the value of this parameter from id in Table 4 by calling the API for querying DB instances.

    Default Value

    N/A

    offset

    Integer

    No

    Definition

    Index offset. The query starts from the next piece of data indexed by this parameter.

    Constraints

    N/A

    Range

    An integer greater than or equal to 0

    Default Value

    The default value is 0, indicating that the query starts from the first data record.

    limit

    Integer

    No

    Definition

    Number of records returned by a query.

    Constraints

    The value cannot be a negative number.

    Range

    1–100

    Default Value

    10

    order

    String

    No

    Definition

    Sorting order.

    Constraints

    N/A

    Range

    • DESC: descending order
    • ASC: ascending order

    Default Value

    DESC

    sort_field

    String

    No

    Definition

    Sorting field.

    Constraints

    N/A

    Range

    • start_time: specifies the start time.
    • end_time: specifies the end time.

    Default Value

    start_time

Request

  • Request parameters

    None

  • URI example
    https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/3aa441c4c98a4b36b100a7e3e87d17cein03/major-version/upgrade-histories?offset=0&limit=10

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    total_count

    Integer

    Definition

    Total number of records.

    Range

    N/A

    upgrade_reports

    Array of objects

    Definition

    Upgrade report details.

    For details, see Table 3.

    Table 3 upgrade_report field data structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    Upgrade report ID.

    Range

    N/A

    start_time

    String

    Definition

    Upgrade start time in the "yyyy-mm-ddThh:mm:ssZ" format.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

    Range

    N/A

    end_time

    String

    Definition

    Upgrade end time in the "yyyy-mm-ddThh:mm:ssZ" format.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

    Range

    N/A

    src_instance_id

    String

    Definition

    Source instance ID.

    Range

    N/A

    src_database_version

    String

    Definition

    Source instance version.

    Range

    N/A

    dst_instance_id

    String

    Definition

    Target instance ID.

    Range

    N/A

    dst_database_version

    String

    Definition

    Target instance version.

    Range

    N/A

    result

    String

    Definition

    Upgrade result.

    Range

    • success: The upgrade is successful.
    • failed: The upgrade fails.
    • running: The upgrade is in progress.

    is_private_ip_changed

    Boolean

    Definition

    Whether to switch the floating IP address of the source instance to the target instance.

    Range

    • true: indicates that the floating IP address of the source instance will be switched to the target instance.
    • false: indicates that the floating IP address of the source instance will not be switched to the target instance.

    private_ip_change_time

    String

    Definition

    Time when the floating IP address is changed. The format is yyyy-mm-ddThh:mm:ssZ.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

    Range

    N/A

    statistics_collection_mode

    String

    Definition

    When to collect statistics.

    Range

    • before_change_private_ip: Statistics are collected before the floating IP address is changed.
    • after_change_private_ip: Statistics are collected after the floating IP address is changed.

    detail

    String

    Definition

    Upgrade report details.

    Range

    N/A

  • Example normal response
    {
             "total_count": 1,
             "upgrade_reports": [
                      {
                                "id": "1a8fda5a-17a6-ebc4-bf1f-97ae837f432b",
                                "start_time": "2023-03-06T02:45:49+0800",
                                "end_time": "2023-03-06T02:50:49+0800",
                                "src_instance_id": "dccacebb7b884ee18bc5c02c918ef2b0in03",
                                "src_database_version": "13.9",
                                "dst_instance_id": "6b5750504be1403191c4f00e4ffaee5ein03",
                                "dst_database_version": "14.6",
                                "result": "success",
                                "is_private_ip_changed": true,
                                "private_ip_change_time": "2023-03-06T03:10:49+0800",
                                "statistics_collection_mode": "before_change_private_ip",
                                "detail": "2023-03-06 18:33:26 --- pg_upgrade upgrade task                         begin"
                      }
             ]
    }

Status Code

Error Code

For details, see Error Codes.