Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Upgrading a Major Version/ Upgrading a Major Version of a DB Instance (RDS for PostgreSQL)
Updated on 2024-06-07 GMT+08:00

Upgrading a Major Version of a DB Instance (RDS for PostgreSQL)

Function

This API is used to upgrade a major version.

  • Before calling an API, you need to understand the API in Authentication.

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.
  • Before an upgrade, ensure that a valid upgrade check report is available. In the check report, the source version is the current instance version, the target version is the one contained in the request body, the check is performed within seven days, and the check result is successful.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/major-version/upgrade

  • Parameter description
    Table 1 Parameter description

    Name

    Type

    Mandatory

    Description

    project_id

    String

    Yes

    Project ID of a tenant in a region.

    To obtain it, refer to Obtaining a Project ID.

    instance_id

    String

    Yes

    Instance ID.

Request

  • Request parameters

    Name

    Type

    Mandatory

    Description

    target_version

    String

    Yes

    Target version.

    It must be later than the current major version of the instance. For example, if the current major version is 12, the target version must be 13 or 14.

    is_change_private_ip

    Boolean

    Yes

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

    • true: After the upgrade, the floating IP address is switched to the target instance.
    • false: After the upgrade, the floating IP address of the source instance remains unchanged, and the target instance uses a new floating IP address.

    statistics_collection_mode

    String

    No

    Mode of collecting statistics. It is mandatory if is_change_private_ip is set to true.

    • before_change_private_ip: Statistics are collected before the floating IP address of the source instance is switched to the target instance.
    • after_change_private_ip: Statistics are collected after the floating IP address of the source instance is switched to the target instance.
  • Example request
    https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/3aa441c4c98a4b36b100a7e3e87d17cein03/major-version/upgrade
    {
       "target_version":  "14.6.1",
       "is_change_private_ip":  true,
       "statistics_collection_mode":  "before_change_private_ip"
    }

Response

  • Normal response
    Table 2 Parameter description

    Name

    Type

    Description

    job_id

    String

    Task ID.

  • Example normal response
    {
       "job_id": "3afe25b7-4523-4d3b-8236-7121be922691"
    }

Status Code

Error Code

For details, see Error Codes.