PostgreSQL major upgrade
Upgrade a PostgreSQL cluster to the next major version (for example 16 → 17 → 18) in place, with pg_upgrade --link, directly from the cluster's Updates tab. Jarwis checks the cluster first, can rehearse the upgrade on a throw-away host, and only then asks for approval to upgrade the live cluster. This is different from rolling updates, which apply minor/patch releases.
?tab=updates) on a PostgreSQL cluster: the major upgrade panel with the precheck, rehearsal and upgrade actions.What is supported
PostgreSQL clusters installed from the PGDG repository: standalone and Patroni clusters. The Updates tab lists the target majors available; if the cluster is not eligible (Percona distribution, a custom data directory, streaming replication without Patroni, or already on the newest major) it tells you why.
The workflow
1 · Pre-check
A read-only check on every node: pg_upgrade --check against a scratch cluster (your data is not touched), free disk space and that the data directory is on one file system (needed for hard links), logical replication slots, prepared transactions, checksum/locale/encoding, and whether each installed extension has a package for the target major. Findings are ranked blocker, warning and info.
2 · Rehearsal
Restores a recent backup to a verify host (the same host used for restore drills), runs the real pg_upgrade --link there, and reports extensions, settings and queries that do not work on the new version, plus the EXPLAIN result of the slowest queries from query analytics. Nothing is done to the live cluster. The verify host must not be a member of the cluster.
3 · Upgrade
Needs a passed rehearsal for the same version pair from the last 14 days, a backup from the last 24 hours, a fresh clean pre-check, and you typing the cluster name to confirm. It goes through approvals like other destructive actions.
4 · Finalize
When you are satisfied, finalize removes the old cluster and its data directory (and optionally the old packages). This cannot be undone.
What happens during the upgrade
- Standalone: the old cluster is stopped, the data directory is upgraded with hard links, and the new cluster starts on the same port.
- Patroni: Patroni is paused, replicas are stopped, the leader is upgraded with
pg_upgrade --link, the cluster configuration is switched to the new binaries and data directory, and the replicas are rebuilt from the new leader. Patroni then resumes. Expect a short outage while the leader restarts. - Afterwards Jarwis updates extensions (
ALTER EXTENSION … UPDATE), runsANALYZE, upgrades the pgBackRest stanza and records the new version on the cluster.
--link shares files with the old data directory, the old cluster can only be restarted automatically while the upgrade has not yet taken the data over. If a failure occurs before that point Jarwis brings the old cluster back by itself; after it, recover from the backup. The upgrade plan shown on the Updates tab lists exactly which steps are still undoable.Automation
The summary, run history and reports are available over the API v1 (read scope); starting a pre-check or rehearsal needs the operate scope and the upgrade and finalize steps need admin.