---
title: "Update a PostgreSQL database"
method: PATCH
path: "/project/{project_id}/location/{location}/postgres/{postgres_database_reference}"
tags: ["Postgres Database"]
---

# Update a PostgreSQL database

`PATCH /project/{project_id}/location/{location}/postgres/{postgres_database_reference}`

## Request body

- object
  - `ha_type` string — High availability type
  - `size` string — Requested size for the underlying VM
  - `storage_size` integer — Requested storage size in GiB
  - `tags` PostgresTag[] — Tags for the Postgres Database
    - `key` string, required — Key of the Postgres tag
    - `value` string, required — Value of the Postgres tag

## Response `200`

A Postgres Database

- object
  - `flavor` string, required — Kind of Postgres database
  - `ha_type` string, required — High availability type
  - `target_server_count` integer, required — Target number of servers (primary + standbys)
  - `id` string, required — ID of the Postgres database
  - `location` string, required — Location of the Postgres database
  - `name` string, required — Name of the Postgres database
  - `state` string, required — State of the Postgres database
  - `storage_size_gib` integer, required — Storage size in GiB
  - `target_storage_size_gib` integer — Desired storage size in GiB
  - `version` '16' | '17' | '18', required — Current Postgres version
  - `target_version` '16' | '17' | '18', required — Target Postgres version
  - `vm_size` string, required — Size of the underlying VM
  - `target_vm_size` string — Desired VM size
  - `ca_certificates` string, nullable — CA certificates of the root CA used to issue postgres server certificates
  - `maintenance_window_start_at` integer, nullable, required — Maintenance window start time
  - `maintenance_window_days` MaintenanceWindowDay[] — Days of the week the maintenance window applies to (empty list means every day)
  - `read_replica` boolean, required — If the database is a read replica or not
  - `parent` string, nullable — Parent Postgres database
  - `fallback_active` boolean, required — Whether the primary server is running on a fallback instance type
  - `tags` PostgresTag[], required — Tags of the Postgres database
    - `key` string, required — Key of the Postgres tag
    - `value` string, required — Value of the Postgres tag
  - `created_at` string, date-time, required — Creation timestamp of the Postgres database
  - `connection_string` string, nullable, required — Connection string to the Postgres database
  - `private_connection_string` string, nullable, required — Private connection string to the Postgres database, accessible from connected subnets
  - `username` string, nullable, required — Username for the Postgres database
  - `password` string, nullable, required — Password for the Postgres database
  - `hostname` string, nullable, required — Hostname for the Postgres database
  - `earliest_restore_time` string, nullable, required — Earliest restore time (if primary)
  - `firewall_rules` PostgresFirewallRule[], required — List of Postgres firewall rules
    - `cidr` string, required — CIDR of the firewall rule
    - `description` string — Port information for the firewall rule
    - `id` string, required — ID of the firewall rule
    - `port` integer — Port for the Postgres firewall rule
  - `latest_restore_time` string, required — Latest restore time (if primary)"
  - `primary` boolean, required — Is the database primary

## Other responses

- `default` — An error response

---

[API](https://skmtc.net/ubicloud/apis/clover-api.md) · [All operations](https://skmtc.net/ubicloud/apis/clover-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ubicloud/clover-api/versions/e8e5db50e9a6/schema)
