Blog
IntermediateReferenceDeployments and Upgrades

PostgreSQL upgrades and patch releases

Minor upgrades as binary replacement, major upgrades through pg_upgrade's link, clone, copy and swap modes, dump and restore, logical replication, extension compatibility, and the Patroni and RDS paths.

Applies to
PostgreSQL15-1919.0 is the current major release; 14 is end of life
matureUpdated Reviewed

Minor and major upgrades are different operations. A minor upgrade (19.0 to 19.1) is a binary replacement: install the new packages, restart, done. The on-disk format never changes inside a major series. A major upgrade must move the data or transform it in place, because system catalogue layout changes between majors.

Minor upgrades

Replace the binaries and restart the server. On a streaming standby pair, upgrade the standby first, then the primary, failing over between them - that is the whole rolling upgrade and the outage is one failover. Under Patroni the same order applies per member; Patroni’s 4.1.5 release notes list PostgreSQL 14.24, 15.19, 16.15, 17.11 and 18.6 as the tested versions, so upgrade PostgreSQL and Patroni within the ranges each supports. Minor releases can change catalogue behaviour in edge cases - check the release notes for the specific minor - but they do not require pg_upgrade or a dump.

Major upgrades: four methods

Method Downtime Disk cost Rollback before cutover
pg_upgrade –link Minutes; proportional to object count, not data size None (hard links) Old directory intact until --check passes and the new one is started
pg_upgrade (copy, –clone, –copy-file-range) Proportional to data size A second copy of the data Same
pg_upgrade –swap Fastest on clusters with many relations Minimal Destructive: the old cluster is modified during transfer and cannot be restarted
Dump and restore (pg_dump / pg_restore) Proportional to data; the slowest Export plus new cluster Old cluster untouched throughout
Logical replication cutover Seconds to minutes A full second cluster Old cluster still runs until the cut

pg_upgrade checks that the old and new clusters are binary-compatible and reuses user data files while building new system catalogues. --clone (reflinks on Linux Btrfs/XFS and macOS APFS) and --copy-file-range (Linux, FreeBSD) give link-like speed without touching the old directory; --swap moves the old data directories into the new cluster and is fastest where there are many small relations but leaves the old cluster unstartable. Run pg_upgrade --check first. Since PostgreSQL 18, clusters carry a default char signedness setting that pg_upgrade preserves; when upgrading to a different CPU platform, upgrade first on the original platform and migrate afterwards, or pass --set-char-signedness explicitly - and do not modify data files between migration and pg_upgrade.

Logical replication is the hand-rolled blue/green: a new cluster on the target version subscribes to the old one, catches up, and applications cut over. It requires a primary key or full replica identity on every table, does not replicate DDL, sequences only from PostgreSQL 10 onward through publication refresh, and - before PostgreSQL 19 - not at all for large objects. It is also the only method that can replicate across architectures and can run cross-version both ways during a transition.

What pg_upgrade does not carry

Statistics are not transferred by default (pg_upgrade copies them unless --no-statistics is given); run ANALYZE or accept plans regressing until autovacuum rebuilds them. Standby servers are not upgraded by pg_upgrade - rebuild them from the new primary. Extensions travel with the dump but must be present in the new installation at a version the new server accepts: upgrade extensions first with ALTER EXTENSION <name> UPDATE, and confirm target-version support - pgvector 0.8.1 added PostgreSQL 18 support and current pgvector installs on PostgreSQL 13 through 19, while TimescaleDB packages top out at PostgreSQL 18 as of 2.32.x, so a TimescaleDB deployment cannot go to 19 yet.

PostgreSQL 19 changes that affect the upgrade itself

The GA release notes flag migration items that surface after the binaries are swapped: parallel vacuum leaders and workers now share the cost-based delay limit (previously each worker slept on its own accounting, so a parallel vacuum could exceed vacuum_cost_limit severalfold); full text search and pg_trgm now use the database’s locale provider for character classification rather than always libc, so pg_upgrade users on ICU or builtin providers should reindex full-text and pg_trgm indexes and recompute stored tsvectors; and fuzzystrmatch changed handling of non-ASCII input (dmetaphone functions now upper-case via the database’s default collation; soundex, metaphone and difference treat only ASCII letters as letters). These are exactly the changes that pass a smoke test and corrupt queries later.

The RDS and Aurora path

On RDS, a blue/green deployment handles the major upgrade for PostgreSQL 11.1+: physical replication for same-major work, logical replication for major upgrades from qualifying source versions (11.21+/12.16+/13.12+/14.9+/15.4+/16.1+). The green side must have every table keyed, extensions updated first, and no self-managed logical publishers or subscribers on blue; AWS recommends increasing logical_decoding_work_mem, setting wal_sender_timeout and wal_receiver_timeout to 0, and a manual vacuum freeze on busy tables before creating the deployment. Under heavy sustained writes, the single-threaded logical apply can lag indefinitely - AWS points at AWS DMS for that case. Details, guardrails and limits: RDS and Aurora blue/green; the major-upgrade-specific contract - what logical replication carries, the replica-identity checks and the post-switchover tail - is in PostgreSQL major upgrades with RDS blue/green.

What breaks, and how to see it

Failure mode Diagnostic
pg_upgrade fails the compatibility check pg_upgrade --check report; usually a missing extension .so or incompatible compile option
Plans regress after a fast upgrade pg_statistic empty until ANALYZE; look for sequential scans in pg_stat_user_tables
Logical subscriber stalls on an unkeyed table UPDATE/DELETE errors in apply worker logs; table lacks replica identity
Extension missing on the new version CREATE EXTENSION errors or restore failures naming the extension; check its supported-PG range first
FTS or trigram indexes return wrong results post-upgrade Locale-provider classification changed in 19 - reindex and recompute stored tsvectors

Trade-offs between the methods

–link is fastest but shares the same filesystem inode-level with the old cluster, which rules out some storage layouts and makes the old directory unusable once the new one starts writing. –swap is faster still on many-relation clusters but is destructive to the old cluster mid-run, so the abort path is narrower. Logical replication has the gentlest cutover and the longest setup, and it silently drops the object classes it cannot replicate. Dump and restore is slowest but the only method that also cleans the data - it is still the fallback when pg_upgrade’s compatibility check fails for reasons that cannot be fixed.

PostgreSQL release support

5 supported
ReleaseLatestReleased
1919.0Nov 2026
1818.7Sept 2025
1717.12Sept 2024
1616.16Sept 2023
1515.20Oct 2022

Data as of 2026-11-21 from endoflife.date. Refresh with node scripts/fetch-versions.mjs.

TimescaleDB release support

1 supported

No published EOL policy for minor versions. Patch releases land on the current minor cycle; in November 2026 an exceptional coordinated fix for PostgreSQL 18.7/17.12/16.16 compatibility was backported across the 2.27-2.32 lines. The support matrix Tiger publishes covers which PostgreSQL majors each cycle works with, not how long the cycle itself is maintained.

ReleaseLatestReleased
2.322.32.1 -

Data as of 2026-11-21 from github.com. Refresh with node scripts/fetch-versions.mjs.