Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for PostgreSQL
  • Getting started
    • All guides
      • Getting information on existing clusters
      • Creating a cluster
      • Updating cluster settings
      • Stopping and starting a cluster
      • Managing PostgreSQL hosts
      • Migrating hosts to a different availability zone
      • Managing replication slots
      • Managing backups
      • Managing backup policies
      • Managing disk space
      • Managing cluster access
      • Maintenance
      • Updating the PostgreSQL version
      • Deleting a cluster
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Before a version upgrade
  • Updating the PostgreSQL version
  • Examples
  1. Step-by-step guides
  2. Clusters
  3. Updating the PostgreSQL version

PostgreSQL version update

Written by
Yandex Cloud
Updated at April 13, 2026
  • Before a version upgrade
  • Updating the PostgreSQL version
  • Examples

You can upgrade the PostgreSQL version in your Managed Service for PostgreSQL cluster to 18 or lower. Note that you can only upgrade a major version step by step, one version at a time.

Note

Upgrade from a standard version to a 1С:Enterprise version (e.g., 14 to 14-1c) is not supported.

How long an upgrade takes depends on the number of affected databases and the number of objects in each of them. The more databases and objects there are, the longer your upgrade will take.

For more information about version upgrades, see Updating the PostgreSQL major version in Managed Service for PostgreSQL.

To learn about updates within the same version and host maintenance, see Maintenance.

Before a version upgradeBefore a version upgrade

Make sure the upgrade will not disrupt your applications:

  1. Check the PostgreSQL release notes to learn how upgrades may affect your applications or installed extensions.
  2. Try upgrading a test cluster. You can deploy it from a backup of the main cluster.
  3. Back up your main cluster before upgrading.

Updating the PostgreSQL versionUpdating the PostgreSQL version

Warning

To upgrade a major version, the following must be free:

  • For disks with a capacity of 100 GB or less: At least 10% of the storage volume.
  • For disks with a capacity of more than 100 GB: At least 10 GB.
Management console
CLI
Terraform
REST API
gRPC API
  1. Go to Managed Service for PostgreSQL.
  2. Select your cluster from the list and click Edit.
  3. In the Version field, select the new version number.
  4. Click Save changes.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id options.

To upgrade a cluster to PostgreSQL version 15 or lower:

  1. Get a list of your PostgreSQL clusters using this command:

    yc managed-postgresql cluster list
    
  2. Get the target cluster details and check its PostgreSQL version in the config.version setting:

    yc managed-postgresql cluster get <cluster_name_or_ID>
    
  3. Start the PostgreSQL upgrade:

    yc managed-postgresql cluster update <cluster_name_or_ID> \
       --postgresql-version <new_version_number>
    
  1. Open the current Terraform configuration file describing your infrastructure.

    For more on how to create this file, see Creating a cluster.

    For a complete list of configurable Managed Service for PostgreSQL cluster fields, see this Terraform provider guide.

  2. Add the version field to the cluster_config section of the target Managed Service for PostgreSQL cluster, or update its value if it already exists:

    resource "yandex_mdb_postgresql_cluster" "<cluster_name>" {
      ...
      cluster_config {
        version = "<PostgreSQL_version>"
      }
    }
    
  3. Validate your configuration.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    Timeouts

    The Terraform provider sets the following timeouts for Managed Service for PostgreSQL cluster operations:

    • Creating a cluster, including restoration from a backup: 30 minutes.
    • Updating a cluster: 60 minutes.
    • Deleting a cluster: 15 minutes.

    Operations exceeding the timeout are aborted.

    How can I change these timeouts?

    Add a timeouts section to the cluster description, e.g.:

    resource "yandex_mdb_postgresql_cluster" "<cluster_name>" {
      ...
      timeouts {
        create = "1h30m" # 1 hour 30 minutes
        update = "2h"    # 2 hours
        delete = "30m"   # 30 minutes
      }
    }
    
  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.Update method, e.g., via the following cURL request:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

    curl \
      --request PATCH \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-postgresql/v1/clusters/<cluster_ID>' \
      --data '{
                "updateMask": "configSpec.version",
                "configSpec": {
                  "version": "<PostgreSQL_version>"
                }
              }'
    

    Where:

    • updateMask: Comma-separated string of settings to update.

      Here, we provide only one setting.

    • configSpec.version: New PostgreSQL version.

    You can get the cluster ID from the folder’s cluster list.

  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the ClusterService.Update method, e.g., via the following gRPCurl request:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the update_mask parameter as an array of paths[] strings.

    Format for listing settings
    "update_mask": {
        "paths": [
            "<setting_1>",
            "<setting_2>",
            ...
            "<setting_N>"
        ]
    }
    
    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/postgresql/v1/cluster_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "cluster_id": "<cluster_ID>",
            "update_mask": {
              "paths": [
                "config_spec.version"
              ]
            },
            "config_spec": {
              "version": "<PostgreSQL_version>"
            }
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.postgresql.v1.ClusterService.Update
    

    Where:

    • update_mask: List of settings you want to update as an array of strings (paths[]).

      Here, we provide only one setting.

    • config_spec.version: New PostgreSQL version.

    You can get the cluster ID with the list of clusters in the folder.

  4. Check the server response to make sure your request was successful.

Once you launch the upgrade, the cluster status changes to UPDATING. Wait for the operation to complete and then check the cluster version.

Cluster upgrade time depends on the database size.

Tip

Contact support if you have issues upgrading to version 18.

ExamplesExamples

Suppose you need to upgrade a cluster from version 14 to 15.

CLI
  1. To get a list of clusters with their IDs and names, run this command:

    yc managed-postgresql cluster list
    
    +----------------------+---------------+---------------------+--------+---------+
    |          ID          |     NAME      |     CREATED AT      | HEALTH | STATUS  |
    +----------------------+---------------+---------------------+--------+---------+
    | c9q8p8j2gaih******** |   postgre406  | 2021-10-23 12:44:17 | ALIVE  | RUNNING |
    +----------------------+---------------+---------------------+--------+---------+
    
  2. To get information about a cluster named postgre406, run the following command:

    yc managed-postgresql cluster get postgre406
    
      id: c9q8p8j2gaih********
      ...
      config:
        version: "14"
        ...
    
  3. To upgrade the postgre406 cluster to version 15, run this command:

    yc managed-postgresql cluster update postgre406 --postgresql-version 15
    

Was the article helpful?

Previous
Maintenance
Next
Deleting a cluster
© 2026 Direct Cursus Technology L.L.C.