Data

PostgreSQL 14 Is End of Life: How to Upgrade to 18 With pg_upgrade

PostgreSQL 14 got its final release on November 12. Here is how to pick a target version, run pg_upgrade, and verify the cutover.

Paige Donnelly

Senior Backend Engineer

Published 7 min read
A hard drive connected to a laptop for data storage
On this page 6 sections

PostgreSQL 14 end of life arrived on November 12, 2026, when 14.25 shipped as the final release. Security and bug fixes have stopped. Upgrade to PostgreSQL 18, supported until November 14, 2030, with pg_upgrade. Rehearse on a copy, run the check pass, cut over, then rebuild planner statistics.

This guide is for backend engineers and database owners who still run PostgreSQL 14, either on their own servers or in a managed service. It covers what end of life means, which target version to pick, how to prepare, how to run pg_upgrade, and what to verify afterward. Backtrace covers databases from the operator's side, so the steps assume a production cluster and a rollback plan to worry about.

The deadline has already passed, but the danger is slow rather than sudden. Every vulnerability disclosed from here on gets fixed in supported versions only, and 14 is no longer one of them. The longer a cluster sits on an unpatched major version, the harder the eventual upgrade gets.

What Does PostgreSQL 14 End of Life Actually Mean?

It means the PostgreSQL project will no longer ship security or bug fixes for version 14. The final release, 14.25, came out on November 12, 2026, alongside the 18.7 update. Your database keeps running, but any vulnerability found from now on will be patched only in versions 15 through 18.

A spiral-bound calendar page with a grid of dates

The PostgreSQL project's release announcement says version 14 will no longer receive security and bug fixes and urges anyone running it in production to plan an upgrade. That same release closed a batch of security issues, including CVE-2026-6460, a type confusion bug rated CVSS 8.8.

Managed services buy extra time. Private DevOps notes that Amazon RDS keeps PostgreSQL 14 on standard support until February 28, 2027. Treat that as a planning date, not a reason to wait. The work on extensions, drivers, and tests does not shrink as the date gets closer.

If you already run 18, your routine work is different. Backtrace's guide to applying the PostgreSQL 18.7 update covers the security fixes and reindex steps for that release.

Unsupported software also becomes a compliance question. Auditors and customer security reviews routinely ask whether production databases receive security patches. A major version past its final release is an easy finding to write up, and it is much cheaper to close before the question arrives.

Which PostgreSQL Version Should You Upgrade To?

Pick the newest major version that has had time to collect minor releases. The table below follows the PostgreSQL versioning policy and shows where each version stands.

Which PostgreSQL Version Should You Upgrade To?
VersionCurrent minorFinal release
1818.7November 14, 2030
1717.12November 8, 2029
1616.16November 9, 2028
1515.20November 11, 2027
1414.25November 12, 2026

PostgreSQL 18 is the sensible target for most clusters. It first shipped on September 25, 2025, and its support window runs four more years. Choosing 15 or 16 means repeating this project in 2027 or 2028.

PostgreSQL 17 is a fair choice when a monitoring agent, backup tool, or extension has not certified 18 yet. Check that list before you decide.

What about 19? The project's planned general availability date is November 19, 2026. Backtrace's editors would not put a brand-new major version under a payments workload in its first week. Let it collect a minor release or two, then plan the 18-to-19 hop as its own project. Going to 18 now does not block that later, since pg_upgrade can move a 14 cluster straight to 18 without stopping at the versions in between.

How to Prepare for a PostgreSQL 14 to 18 Upgrade

Do this work before the maintenance window, not during it. The following list covers what to settle first.

  • List every extension in use with SELECT extname, extversion FROM pg_extension and confirm a build exists for 18.
  • Read the release notes for 15, 16, 17, and 18, because each major release can change behavior your queries rely on.
  • Confirm that client drivers, ORMs, and connection poolers support the new server version.
  • Check free disk space and the file system, since link mode needs both data directories on the same one.
  • Take a verified backup and test a restore, not just a dump.
  • Restore a copy of production and rehearse the whole procedure on it.

The pg_upgrade documentation says the shared object files for each extension must be installed for the new server. It also says not to run CREATE EXTENSION again, because the schema definitions are copied over from the old cluster.

Time the rehearsal. The number that matters for your change request is downtime, and copy, link, and clone modes give very different answers on a large cluster. Write the measured figure into the runbook so the maintenance window is a fact rather than a guess.

Write the rollback plan down before the window opens. Decide which failure aborts the upgrade, who makes that call, and what restoring from backup would take in minutes. A plan that exists only in someone's head will not survive a 2 a.m. cutover.

On a managed service, the provider's major-version upgrade tool does the heavy lifting. Rehearse anyway by restoring a snapshot into a new instance and upgrading that copy, so you learn about extension and parameter surprises before production does.

How Do You Run pg_upgrade Safely?

Install the PostgreSQL 18 binaries, initialize a new cluster with compatible initdb flags, and stop both servers. Run the new version's pg_upgrade with the check option first, then run it for real. Start the new server and regenerate statistics with vacuumdb. Keep the old cluster until the application passes its checks.

Lines of source code on a dark screen

The sequence below follows the official procedure, shortened to the steps most teams need.

  1. Install the PostgreSQL 18 server binaries and the matching extension packages.
  2. Run initdb for the new cluster with flags compatible with the old one, and leave it stopped.
  3. Stop the old and new servers.
  4. Run the check pass and fix everything it reports.
  5. Run the upgrade, restore any pg_hba.conf changes, and start the new server.
  6. Regenerate optimizer statistics.

This example uses Debian-style paths, so adjust them to your layout. Always run the pg_upgrade binary that ships with the new server, and drop --check for the real run.

text
/usr/lib/postgresql/18/bin/pg_upgrade --check \
  --old-bindir=/usr/lib/postgresql/14/bin \
  --new-bindir=/usr/lib/postgresql/18/bin \
  --old-datadir=/var/lib/postgresql/14/main \
  --new-datadir=/var/lib/postgresql/18/main \
  --link --jobs=4

The docs describe the statistics step in two passes. Run vacuumdb --all --analyze-in-stages --missing-stats-only first to produce minimal statistics quickly. Then run vacuumdb --all --analyze-only so every relation has current cumulative statistics for vacuum and analyze triggers.

Standby servers need their own handling. Before the upgrade, the documentation says to run pg_controldata against the old primary and each standby and verify that the latest checkpoint location matches in all of them. The standbys must also be running while the primary shuts down, so they receive every last change.

The transfer mode decides your rollback options. Link mode is fast and uses less disk, but you cannot use the old cluster after you start the new one. Clone mode keeps the old cluster usable, though it only works on certain file systems, such as Btrfs or XFS with reflink support on Linux. Swap mode can be fastest with many relations, but the old cluster is gone once the file transfer begins.

What Should You Verify After the Cutover?

Run this checklist before you declare the upgrade done.

  • Run the application's smoke tests against the new server, including the write paths.
  • Confirm that every streaming standby is upgraded, attached, and caught up.
  • Restore customized pg_hba.conf and postgresql.conf settings.
  • Compare slow-query logs and key query plans against the numbers from your rehearsal.
  • Read the post-upgrade warnings from pg_upgrade for any extra steps it lists.
  • Keep the old cluster, or a restorable backup, until the checks pass.
A computer screen showing blurred charts and data

Query plans can change after a major upgrade. A newer planner usually helps, but one regressed query on a hot path can dominate your latency. Capture the top queries by total time with pg_stat_statements before the upgrade, then compare the same list a day after cutover.

Plan for retries at cutover. Even a clean restart drops connections, and clients that retry blindly can create duplicate writes. Backtrace's guide to making API retries safe with idempotency keys shows how to keep a dropped write from becoming a duplicate one.

Delete the old cluster last. The documentation lists it as the final step, and it should wait until the application has run on the new server through a full business cycle. In link mode your only way back after the new cluster starts is a restore from backup, so make sure that backup exists before anyone touches production.

What to Do Before PostgreSQL 19 Arrives

Start with the inventory. List your extensions, drivers, and poolers, and confirm each one supports 18. Then schedule the rehearsal on a restored copy this week and put the measured downtime in the runbook.

Deadlines like this one reward early rehearsal. Backtrace's plan for the Kubernetes 1.34 end of life follows the same rule, which is to treat a support date as the day you should have finished testing. At Backtrace, we would rather see a boring upgrade on a Tuesday than an urgent one after the next disclosure.

Is it safe to keep running PostgreSQL 14 after November 12, 2026?
It will keep running, but it no longer receives security or bug fixes. Any vulnerability disclosed after the final 14.25 release stays open on your cluster. That is acceptable for a short, planned window while you rehearse an upgrade, and a poor choice as a long-term position on a production database.
Can I upgrade from PostgreSQL 14 straight to 18?
Yes. pg_upgrade can move a 14 cluster directly to 18 without stopping at 15, 16, or 17. You still need to read the release notes for every major version in between, because behavior changes accumulate, and you should rehearse the jump on a restored copy before running it against production.
Should I wait for PostgreSQL 19 instead of moving to 18?
No. PostgreSQL 19 is planned for general availability on November 19, 2026, and a new major version benefits from a minor release or two before it carries production traffic. Move to 18 now, which is supported until November 2030, and treat the later hop to 19 as a separate project.
What is the difference between link and clone mode in pg_upgrade?
Link mode uses hard links, so it is fast and light on disk, but the old cluster becomes unusable once the new one starts. Clone mode gives similar speed while leaving the old cluster usable, but it needs a file system such as Btrfs or XFS with reflink support. Both need the data directories on one file system.

Written by

Paige Donnelly

Senior Backend Engineer

8+ years experience

Paige Donnelly is a senior backend engineer who has spent the last eight years working on distributed systems, first at a mid-size fintech and then leading a payments infrastructure team through a migration from a monolith to event-driven services. She's on the losing end of more 3am pages than she'd like to admit, which is why she writes about observability, deployment safety, and API design with an eye toward what actually breaks in production rather than what looks good in a conference talk. She contributes to a couple of open-source CLI tools in her spare time and still refuses to use a debugger for anything she can solve with well-placed logs.

Credentials

  • 8 years in backend and distributed systems engineering
  • Former tech lead, payments infrastructure at a Series D fintech
  • Contributor to several open-source developer tooling projects