SQLNirvana by Pyro

Blog › postgresql · upgrade

PostgreSQL 14 reaches end of life in November 2026: upgrading with pg_upgrade

PostgreSQL 14 gets its final release in November 2026. A practical plan for moving to PostgreSQL 17 with pg_upgrade, and when logical replication is the better route.

The PostgreSQL project supports each major version for five years. PostgreSQL 14 was released in 2021, so its final minor release is due in November 2026. After that there are no more fixes, security or otherwise. PostgreSQL 13 already reached end of life in November 2025.

Which version to move to

Go to the newest version your extensions and tooling support, usually PostgreSQL 17 or 18. Each major version is supported for five years from its release, so a newer target buys you more time before the next upgrade.

Option 1: pg_upgrade (minutes of downtime)

pg_upgrade converts the old cluster's catalogs for the new version and reuses the data files. With --link it uses hard links instead of copying, so even large databases upgrade in minutes.

  1. Install the new version next to the old one, including the same extensions (PostGIS, pg_stat_statements and so on) built for the new version.
  2. Take a backup and make sure it restores.
  3. Initialise the new cluster with the same locale and encoding settings as the old one.
  4. Check first:
pg_upgrade --old-bindir=/usr/lib/postgresql/14/bin --new-bindir=/usr/lib/postgresql/17/bin \
           --old-datadir=/var/lib/postgresql/14/main --new-datadir=/var/lib/postgresql/17/main \
           --link --check
  1. Fix whatever it reports, stop the old server, and run the same command without --check.
  2. Start the new server and rebuild planner statistics, which pg_upgrade doesn't carry over:
vacuumdb --all --analyze-in-stages
  1. Copy over your settings from the old postgresql.conf and pg_hba.conf, review them, and update connection strings or ports if they changed.

About --link: once the new cluster has started, the old one shares its data files and must not be started again. Your rollback from that point is the backup. Without --link, pg_upgrade copies the data (slower, needs double the disk) and the old cluster stays usable.

Option 2: logical replication (near-zero downtime)

For databases that can't stop for even a few minutes, build a new server on the new version, replicate into it with logical replication (CREATE PUBLICATION / CREATE SUBSCRIPTION), let it catch up, then switch the application over. It takes more preparation: every replicated table needs a primary key or replica identity, sequences and schema changes aren't replicated automatically, and you need to plan the cut-over.

Things to check before either route

SQLNirvana's Upgrade tab checks your server against these points (extensions, slots, replicas, password hashing, prepared transactions) and lists the steps for your exact versions. The free PostgreSQL check includes a summary.

Let SQLNirvana watch it for you

Health, tuning, security and upgrade checks every minute. Free for one server.

Start free