Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • 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
© 2025 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
      • 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:

  • Getting the maintenance list
  • Getting maintenance-related cluster logs
  • Postpone the planned maintenance
  • Starting scheduled maintenance immediately
  • Configuring a maintenance window
  1. Step-by-step guides
  2. Clusters
  3. Maintenance

PostgreSQL cluster maintenance

Written by
Yandex Cloud
Updated at December 5, 2025
  • Getting the maintenance list
  • Getting maintenance-related cluster logs
  • Postpone the planned maintenance
  • Starting scheduled maintenance immediately
  • Configuring a maintenance window

You can manage the technical maintenance of a Yandex Managed Service for PostgreSQL cluster.

Getting the maintenance listGetting the maintenance list

  1. Go to Managed Service for PostgreSQL.
  2. Click the name of your cluster and open the Technical maintenance tab.

To view maintenance events with a specific status, click Status above the maintenance list and select the status you want from the drop-down menu. You can also find a maintenance event by its ID or job name using the search field above the list.

Getting maintenance-related cluster logsGetting maintenance-related cluster logs

  1. Go to Managed Service for PostgreSQL.
  2. Click the name of your cluster and open the Technical maintenance tab.
  3. Click the ID of the maintenance event you need.
  4. Click Task logs.

Postpone the planned maintenancePostpone the planned maintenance

Maintenance jobs with the Planned status have a specific scheduled date and time specified in the Start date column. You can reschedule them to a new date and time if needed.

Management console
CLI
REST API
gRPC API

To reschedule a maintenance job to a new date and time:

  1. Go to Managed Service for PostgreSQL.
  2. Click the name of your cluster and open the Technical maintenance tab.
  3. Click next to the maintenance job with the Planned status.
  4. In the drop-down menu, select Postpone.
  5. In the window that opens, do the following:
    • To postpone the maintenance until the next available window, click Next window and then Reschedule.
    • To reschedule maintenance to a specific UTC date and time, click Choose date (UTC), then select a new date and time interval and click Reschedule.

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

By default, the CLI uses the folder specified when creating the 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 parameter.

To reschedule a maintenance job to a new date and time:

  1. See the description of the CLI command for rescheduling maintenance:

    yc managed-postgresql cluster reschedule-maintenance --help
    
  2. To reschedule the maintenance to the next available window, run this command using the next-available-window reschedule type. To reschedule the maintenance to a specific date and time, use the specific-time reschedule type:

    yc managed-postgresql cluster reschedule-maintenance <cluster_name_or_ID> \
       --reschedule-type <reschedule_type> \
       --delayed-until <timestamp>
    

    The timestamp must be in one of the following formats:

    • RFC-3339
    • HH:MM:SS
    • Number of hours and minutes by which to move the maintenance.

    For example, 2006-01-02T15:04:05Z, 15:04:05, 2h, or 3h30m ago. When selecting the next-available-window reschedule type, you do not need to specify --delayed-until.

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

To reschedule a maintenance job to a new date and time:

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

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

    curl \
    --request POST \
    --header "Authorization: Bearer $IAM_TOKEN" \
    --header "Content-Type: application/json" \
    --url 'https://mdb.api.cloud.yandex.net/managed-postgresql/v1/clusters/<cluster_ID>:rescheduleMaintenance' \
    --data '{
                "rescheduleType": <reschedule_type>,
                "delayedUntil": <timestamp>
            }'
    

    Where rescheduleType is the reschedule type that can be one of the following values:

    • NEXT_AVAILABLE_WINDOW: Postpone maintenance until the next available window.
    • SPECIFIC_TIME: Move the maintenance to a specific date and time.

    The timestamp must be in RFC-3339 format, e.g., 2006-01-02T15:04:05Z. When selecting the NEXT_AVAILABLE_WINDOW reschedule type, you do not need to specify delayedUntil.

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

  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 the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.RescheduleMaintenance call to execute the following request via gRPCurl:

    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>",
            "reschedule_type": <reschedule_type>,
            "delayed_until": <timestamp>
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.postgresql.v1.ClusterService.RescheduleMaintenance
    

    Where reschedule_type is the reschedule type that can be one of the following values:

    • NEXT_AVAILABLE_WINDOW: Move the maintenance to the nearest window.
    • SPECIFIC_TIME: Move the maintenance to a specific date and time.

    The timestamp must be in RFC-3339 format, e.g., 2006-01-02T15:04:05Z. When selecting the NEXT_AVAILABLE_WINDOW reschedule type, you do not need to specify delayed_until.

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

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

Starting scheduled maintenance immediatelyStarting scheduled maintenance immediately

If necessary, you can run a maintenance job with the Planned status immediately, prior to the time specified in the Start date column.

Management console
CLI
REST API
gRPC API

To run a scheduled cluster maintenance job immediately:

  1. Go to Managed Service for PostgreSQL.
  2. Click the name of your cluster and open the Technical maintenance tab.
  3. Click next to the maintenance job you need.
  4. In the drop-down menu, select Carry out now.

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

By default, the CLI uses the folder specified when creating the 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 parameter.

To run a scheduled cluster maintenance job immediately:

  1. See the description of the CLI command for rescheduling maintenance:

    yc managed-postgresql cluster reschedule-maintenance --help
    
  2. Run this command using the immediate reschedule type:

    yc managed-postgresql cluster reschedule-maintenance <cluster_name_or_ID> \
       --reschedule-type immediate
    

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

To run a scheduled cluster maintenance job immediately:

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

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

    curl \
    --request POST \
    --header "Authorization: Bearer $IAM_TOKEN" \
    --header "Content-Type: application/json" \
    --url 'https://mdb.api.cloud.yandex.net/managed-postgresql/v1/clusters/<cluster_ID>:rescheduleMaintenance' \
    --data '{
                "rescheduleType": "IMMEDIATE"
            }'
    

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

  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 the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.RescheduleMaintenance call to execute the following request via gRPCurl:

    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>",
            "reschedule_type": "IMMEDIATE"
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.postgresql.v1.ClusterService.RescheduleMaintenance
    

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

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

Configuring a maintenance windowConfiguring a maintenance window

By default, maintenance can be scheduled for any time. You can choose a specific day of the week and hour to schedule maintenance. For example, you can choose the time when the cluster is least busy.

Warning

When you select a new maintenance window, any scheduled maintenance that does not fall within it will be automatically canceled.

Management console
CLI
Terraform
REST API
gRPC API
  1. Go to Managed Service for PostgreSQL.
  2. Click the name of your cluster and open the Technical maintenance tab.
  3. Click Configure the maintenance window.
  4. In the window that opens, do the following:
    • To allow maintenance at any time, select arbitrary, which is also the default option.
    • To allow weekly maintenance at a specific time, select by schedule and specify the weekday and hour in UTC.

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

By default, the CLI uses the folder specified when creating the 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 parameter.

  1. See the description of the CLI command for updating the maintenance window:

    yc managed-postgresql cluster update --help
    
  2. Run this command:

    yc managed-postgresql cluster update <cluster_name_or_ID> \
       --maintenance-window type=<maintenance_type>,`
                           `day=<day_of_week>,`
                           `hour=<hour>
    

    Where type is the maintenance type:

    • anytime: At any time (default).
    • weekly: On a schedule. For this value, also specify the following:
      • day: Day of week, i.e., MON, TUE, WED, THU, FRI, SAT, or SUN.
      • hour: Hour of day (UTC), from 1 to 24.

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

  1. Open the current Terraform configuration file describing your infrastructure.

    To learn how to create this file, see Creating a cluster.

    For a complete list of configurable Managed Service for PostgreSQL cluster fields, refer to the Terraform provider guides.

  2. To set up the maintenance window (for disabled clusters as well), add the maintenance_window section to the cluster description:

    resource "yandex_mdb_postgresql_cluster" "<cluster_name>" {
      ...
      maintenance_window {
        type = <maintenance_type>
        day  = <day_of_week>
        hour = <hour>
      }
      ...
    }
    

    Where:

    • type: Maintenance type. The possible values include:
      • ANYTIME: Anytime
      • WEEKLY: On a schedule
    • day: Day of week for the WEEKLY type, i.e., MON, TUE, WED, THU, FRI, SAT, or SUN.
    • hour: UTC hour for the WEEKLY type, from 1 to 24.
  3. Check if the settings are correct.

    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.

    Time limits

    A Terraform provider sets the timeout for Managed Service for PostgreSQL cluster operations:

    • Creating a cluster, including restoring from a backup: 30 minutes.
    • Editing a cluster: 60 minutes.
    • Deleting a cluster: 15 minutes.

    Operations exceeding the set timeout are interrupted.

    How do I change these limits?

    Add the timeouts block to the cluster description, for example:

    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": "maintenanceWindow",
                "maintenanceWindow": {
                  "weeklyMaintenanceWindow": {
                    "day": "<day_of_week>",
                    "hour": "<hour>"
                  }
                }
              }'
    

    Where:

    • updateMask: Comma-separated list of settings you want to update.

      Here, we provide only one setting.

    • maintenanceWindow: Maintenance window settings, including those for disabled clusters. In maintenanceWindow, provide one of the following values:

      • anytime: Maintenance can be scheduled at any time.

      • weeklyMaintenanceWindow: Maintenance can be scheduled to selected day of week and time only:

        • day: Day of week in DDD format: MON, TUE, WED, THU, FRI, SAT, or SUN.
        • hour: Time of day (UTC) in HH format, from 1 to 24.

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

  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 the repository contents are stored 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": ["maintenance_window"]
            },
            "maintenance_window": {
              "weekly_maintenance_window": {
                "day": "<day_of_week>",
                "hour": "<hour>"
              }
            }
          }' \
      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.

    • maintenance_window: Maintenance window settings, including those for disabled clusters. In maintenance_window, provide one of the two values:

      • anytime: Maintenance can be scheduled at any time.

      • weekly_maintenance_window: Maintenance can be scheduled to selected day of week and time only:

        • day: Day of week in DDD format: MON, TUE, WED, THU, FRI, SAT, or SUN.
        • hour: Time of day (UTC) in HH format, from 1 to 24.

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

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

Was the article helpful?

Previous
Managing disk space
Next
Updating the PostgreSQL version
© 2025 Direct Cursus Technology L.L.C.