DEV Community

Kamal G for Database Engineering

Posted on Edited on

Postgres 14 Is End-of-Life: Documented Upstream Migration-Impacting Changes from 14 to 19

TL;DR

PostgreSQL 14 received its final release, 14.25, on November 12, 2026 and is now unsupported. PostgreSQL 19.0 shipped seven days later. A direct pg_upgrade from 14 to a supported version is possible if the clusters meet the tool's requirements, but the tool checks binary layout, not application SQL or third-party module compatibility. Five major versions of accumulated behavior changes sit between the two releases:

  • PG 15 revoked the default PUBLIC CREATE privilege on the public schema for new databases, tightened SQL parsing, aligned JSON numeric parsing with SQL/JSON rules, and changed interval rounding.
  • PG 16 restricted CREATEROLE powers and removed server configuration parameters (GUCs) including vacuum_defer_cleanup_age and promote_trigger_file.
  • PG 17 locked down the maintenance search_path, which can cause expression-index functions that rely on unqualified names for objects in non-default schemas to fail during maintenance.
  • PG 18 enabled data checksums by default in initdb. For clusters using a non-libc default collation provider whose character classification differs from libc, its release notes recommend reindexing indexes related to full-text search and pg_trgm after pg_upgrade.
  • PG 19 forced standard_conforming_strings = on, changed the max_locks_per_transaction default from 64 to 128 (custom values must effectively be doubled to retain their previous capacity), and disabled JIT by default.

A clean pg_upgrade --check is not application certification. Rehearse on a representative copy, run regression suites, and design the rollback path before writes reach the new cluster.

Why PostgreSQL 14 clusters need a migration plan now

After November 12, 2026, any newly discovered security vulnerability in PostgreSQL 14 will remain unpatched. Production clusters need a migration plan to a supported target. Because the project supports upgrades from version 9.2 onward, administrators can use pg_upgrade to jump directly to PostgreSQL 19, which shipped on November 19.

A successful pg_upgrade --check establishes that its tested cluster prerequisites pass. It does not certify application SQL or external-module behavior. PostgreSQL 15 changes the default public schema privileges for newly created databases, while upgraded databases retain their existing grants. PostgreSQL 17's restricted maintenance search_path can expose functions that rely on unqualified names, and PostgreSQL 19 changes how ordinary string literals containing backslashes are interpreted when applications previously depended on standard_conforming_strings = off.

Review the migration notes for each release from 15 through 19, then validate the cumulative changes in privileges, configuration, and runtime behavior beyond a basic layout check.

Version Current minor Supported Support end date
14 14.25 No 2026-11-12
15 15.20 Yes 2027-11-11
16 16.16 Yes 2028-11-09
17 17.12 Yes 2029-11-08
18 18.7 Yes 2030-11-14
19 19.0 Yes 2031-11-19

PostgreSQL 19 offers the longest runway but shipped on November 19, 2026, so it carries minimal post-release field history. PostgreSQL 18 has had more time for operational exposure.

pg_upgrade supports upgrades from PostgreSQL 9.2 onward, so a direct 14-to-19 jump is mechanically possible. However, the tool establishes binary-layout compatibility, not application or module safety. Five sets of migration notes contain privilege changes, SQL-parsing strictness, removed GUCs, collation-index risks, and lock-sizing changes that can silently break a production workload.

Version-by-version breaking changes: PostgreSQL 15 through 19

The five major versions between 14 and 19 accumulate incompatibilities in privileges, SQL parsing, configuration, maintenance behavior, authentication, and monitoring interfaces.

Version Primary impact areas
15 Privileges, SQL/JSON parsing, text search
16 Role restrictions, GUC removals, reindex scope
17 Maintenance search_path, interval strictness, catalog renames
18 Checksums by default, conditional full-text-search/pg_trgm reindexing, COPY/trigger behavior
19 String conformance, lock sizing, JIT default, I/O settings

PostgreSQL 15: privileges, parsing, and text search

PUBLIC CREATE on public schema revoked for new databases. Previously, roles could create objects in the public schema through its default grant to PUBLIC. PostgreSQL 15 revokes this default grant: in newly created databases, the schema owner (pg_database_owner) has CREATE by default, and administrators can grant it to other roles. Existing databases upgraded via pg_upgrade or restored from a grant-preserving dump retain their old permissions. In each database, use \dn+ public or inspect pg_namespace.nspacl to audit the schema's privileges. Revoke or grant as intended.

Implicit ADMIN OPTION on own role removed. Role-provisioning scripts that assumed a login role could manage its own membership now need explicit ADMIN OPTION grants.

Logical-replication permission changes. For replicated UPDATE and DELETE operations, the subscription owner needs SELECT permission on the subscriber table. Check the subscription owner's privileges on target tables, including any row-level-security restrictions.

SQL parsing tightened. PG 15 rejects the following previously accepted SQL inputs:

  • Negative chr() arguments now produce an error.
  • CREATE OR REPLACE VIEW cannot change an output column's collation.
  • Zero-length Unicode identifiers are disallowed.
  • Numeric literals with trailing non-numeric text are rejected.
  • JSON numeric parsing is aligned with SQL/JSON rules.

Grep application SQL, dynamic SQL generators, and JSON ingestion paths for patterns that relied on lenient parsing.

Interval rounding changed. 1.99 years now rounds to 2 years rather than 1 year 11 months. Test any code that parses human-formatted interval strings or depends on exact fractional-interval conversion.

Empty text-search lexemes can cause dump/restore failures or inconsistent results. Check text-search configurations and data before choosing dump/restore as the upgrade method.

stats_temp_directory removed. Remove it from configuration templates and startup arguments.

PostgreSQL 16: role restrictions, generated columns, and reindex scope

CREATEROLE powers restricted. Adding members now requires ADMIN OPTION. Changing properties like CREATEDB, REPLICATION, or BYPASSRLS requires the corresponding authority. Scripts without sufficient authority can error, while the new grant-time inheritance setting can change the effective privileges of a successful role grant. Exercise provisioning and role-maintenance automation with realistic (non-superuser) privileges on a test cluster.

PL/pgSQL bound-cursor assignment rules changed. Code relying on the prior implicit portal-name behavior must assign the desired portal name before OPEN.

NULLS NOT DISTINCT indexes cannot serve as primary keys. Inventory schema-generation code that creates such indexes.

REINDEX DATABASE / reindexdb no longer processes system indexes. Use REINDEX SYSTEM or reindexdb --system when system indexes are intended. Audit maintenance scripts that assumed one command rebuilt both user and system indexes.

Generated-column restrictions tightened for inherited and partitioned tables. Validate DDL and migration scripts.

Manual view creation via ON SELECT rules removed.

Removed / renamed GUC Action
vacuum_defer_cleanup_age Remove from config
promote_trigger_file Remove from config and failover scripts
lc_collate, lc_ctype (read-only) Remove any references that read these settings
force_parallel_mode (renamed to debug_parallel_query) Update config and scripts

Diff every postgresql.conf, ALTER SYSTEM record, and config-management template against this list.

PostgreSQL 17: maintenance search_path, interval strictness, and catalog changes

Maintenance operations use a safe search_path. Functions used by expression indexes or materialized views that reference objects in non-default schemas must set search_path in the function definition or use schema-qualified references. Such functions can succeed in an application session yet fail during ANALYZE, CLUSTER, CREATE INDEX, CREATE MATERIALIZED VIEW, REFRESH MATERIALIZED VIEW, REINDEX, or VACUUM, which use a restricted path. Inspect the affected function definitions and test the listed commands that exercise those functions.

Interval input stricter. ago must appear only at the end, and empty interval units cannot repeat. Test imported or hand-built interval strings.

SET SESSION AUTHORIZATION handling now depends on the session user's superuser status when the command is issued. Test administrative scripts that change session authorization and then execute privileged operations.

Removed GUC, module, or GUC value Notes
old_snapshot_threshold Remove from config
db_user_namespace Remove from config
adminpack Removed from bundled contrib. Install separately if needed.
fsync_writethrough as wal_sync_method (Windows) Use an alternative sync method

Catalog and statistics interface changes. stxstattarget default is now represented as NULL. Collation catalog columns were renamed, a vacuum-progress column changed, SLRU statistics columns and accepted reset names changed, and WAL filename-function boundary handling changed. Audit monitoring SQL, dashboards, and custom scripts that read pg_stat_* views or catalog columns.

PostgreSQL 18: checksums by default, collation reindex, and COPY changes

initdb enables data checksums by default. When preparing a new cluster for pg_upgrade, match the old cluster's checksum setting. Use --no-data-checksums if the source cluster has checksums off, because mismatched settings cause pg_upgrade to refuse the upgrade. Check the existing cluster with SHOW data_checksums or pg_controldata and pass the matching flag.

Full-text-search character classification changed. PostgreSQL 18 uses the cluster's default collation provider rather than always libc to read full-text-search configuration files and dictionaries. For clusters using a non-libc default provider whose behavior differs from libc for characters processed by LC_CTYPE, the PG 18 release notes recommend reindexing all indexes related to full-text search and pg_trgm after pg_upgrade. Check provider and locale settings, inventory those indexes rather than all indexes on text columns, and estimate reindex time and temporary disk on a representative copy.

Time-zone abbreviation resolution changed. The session's current time-zone abbreviation is now favored over timezone_abbreviations. Test parsing of ambiguous abbreviations in application inputs.

MD5 password authentication deprecated. PostgreSQL 18 issues warnings when MD5 password verifiers are set with CREATE ROLE or ALTER ROLE. PostgreSQL 19 also warns after successful MD5 authentication. MD5 support is planned for removal in a future release. Inventory md5 entries in pg_hba.conf and MD5 password verifiers in pg_authid. Plan migration to scram-sha-256.

VACUUM and ANALYZE default scope changed. Operations now cover inheritance and partition hierarchies by default. Use ONLY for the previous single-table behavior. Review maintenance jobs targeting partitioned tables. Check whether broader scope changes maintenance-window duration.

Server-side COPY FROM no longer treats \. as end-of-file in CSV files. The sequence is now treated as literal data. psql's \copy from STDIN retains the old behavior. Test every CSV import path with the exact server/client version combinations. Distinguish server-side COPY FROM file from psql \copy STDIN.

AFTER triggers execute as the role active when trigger events were queued, rather than the role executing the firing statement. Test trigger functions whose behavior depends on the executing role.

Unlogged partitioned tables disallowed. Check DDL scripts that attempt to set partitioned tables unlogged.

PostgreSQL 19: string conformance, lock sizing, and JIT default

standard_conforming_strings forced to on. Backslash escapes in ordinary string literals are no longer interpreted. Hand-written SQL, migration SQL, and SQL in old dump files that relied on backslash escapes in regular (non-E'') strings will silently change meaning or cause errors. Search application code, stored procedures, migration scripts, and seed files for single-quoted strings containing backslashes. Replace with escape-string syntax (E'...') or dollar-quoted literals where needed. Create and load a test dump using the target-version pg_dump/pg_restore before cutover.

Full-text search and pg_trgm use the database's locale provider for character classification. In a non-libc database whose provider classifies characters differently from its LC_CTYPE setting, PostgreSQL 19 recommends reindexing affected full-text-search and pg_trgm indexes and recomputing stored tsvector values after pg_upgrade.

Carriage returns and line feeds disallowed in database, role, and tablespace names. pg_upgrade refuses clusters with affected names. Query pg_database, pg_roles, and pg_tablespace for names containing chr(10) or chr(13). Rename affected objects before scheduling the upgrade.

max_locks_per_transaction default changed from 64 to 128. Lock allocation also changed: a custom value must effectively be doubled to match its capacity in earlier releases. The doubled default preserves the prior default's effective capacity rather than establishing a capacity increase. Compare any explicitly tuned value with the workload's peak lock demand, then set and test a PostgreSQL 19 value that meets that peak lock demand.

io_workers removed. PostgreSQL 19 lets io_method = worker manage worker processes automatically. Its replacement controls are io_min_workers, io_max_workers, io_worker_idle_timeout, and io_worker_launch_interval. Because there is no direct one-for-one value to copy, review a former io_workers setting against the new worker-pool behavior.

JIT disabled by default. Analytical workloads that benefited from JIT need explicit jit = on and benchmarking after upgrade. Identify queries whose plans show JIT activity before the upgrade.

json_array() returns an empty array instead of NULL when no rows match. Check application logic that distinguishes NULL from [] in json_array() results.

System columns disallowed in COPY FROM ... WHERE. Search import statements and generated SQL for system-column references.

Password-expiration warning setting added (default: seven days). Successful MD5 authentication also warns. RADIUS support removed. Review authentication configuration and client methods.

Parallel vacuum cost-delay budget now shared between leader and workers. Where cost-based delay is enabled, parallel vacuum may take longer than under the previous accounting. Review maintenance windows and vacuum_cost_delay / vacuum_cost_limit settings.

Monitoring rename Old name New name
Subscription stats column sync_error_count sync_table_error_count

Update monitoring queries and alert rules. The BUFFERPIN wait-event type and BufferPin wait event were also renamed in PG 19. Check the PG 19 wait-event documentation for the current names and update dashboards accordingly.

Core server versus adjacent upgrade surfaces

Bundled modules, external extensions, and deployment environments can cause upgrade failures apart from core PostgreSQL behavior. Check each surface separately during preflight.

Bundled contrib modules

Changes to modules shipped with PostgreSQL affect installations that use those modules. Examples include the removed xml2 function (PG 15), pg_walinspect changes (PG 16), and adminpack removal (PG 17). In PG 19, postgres_fdw propagates read-only transaction status, while pg_upgrade refuses clusters with btree_gist inet or cidr indexes. Inventory those indexes before scheduling the upgrade. Treat these as module-specific checks rather than general SQL incompatibilities.

External extensions and custom modules

pg_upgrade cannot certify external shared-library compatibility. Install target-version binaries, follow extension update scripts, and rehearse the exact module set on a copy. An incompatible extension can block an upgrade. pg_upgrade failed with an incompatible extension in one reported TimescaleDB case. pg_upgrade failed in another reported case because an external shared library was missing, a module-installation problem rather than a core PostgreSQL incompatibility. Check each extension's documented version-support matrix before beginning rehearsal.

Packages, containers, and managed services

A changed container data-directory layout, a missing shared library in a platform image, or a managed-service upgrade restriction is a deployment-environment issue. Packaging and environment problems distinct from upstream SQL changes arose with docker-library/postgres and cloudnative-pg. Include provider-specific and container-specific checks in the deployment runbook, separately from the core compatibility inventory.

PostgreSQL upgrade methods, rehearsal, and rollback design

PostgreSQL supports three upgrade families: logical backup and restore, in-place migration with pg_upgrade, and logical replication to a new-version server. Each has different downtime characteristics, rollback boundaries, and validation requirements.

Upgrading via pg_upgrade: direct in-place migration

pg_upgrade supports upgrades from 9.2 onward. Use the target version's pg_upgrade binary, not the source version's. Run pg_upgrade --check first. Use compatible build and initdb settings (including matching checksum settings for PG 18+). Ensure no connections to either cluster during the actual upgrade. The check identifies some issues but cannot verify external-module ABI compatibility or application behavior.

Link mode avoids copying files and is fast, but once the new cluster uses shared files the old cluster is not a safe rollback target. Clone mode can preserve the old cluster when supported by the filesystem. Copy mode preserves the old cluster for rollback but takes longer because it duplicates the data files. Writes accepted by the new cluster still require recovery before rollback. For large databases, pg_upgrade supports parallel file processing with --jobs to reduce upgrade duration.

Post-upgrade statistics. PostgreSQL 19's pg_upgrade transfers most optimizer statistics unless --no-statistics is specified. It does not transfer every statistic, including some extension and cumulative statistics. Follow its post-upgrade instructions: run vacuumdb --all --analyze-in-stages --missing-stats-only to supply statistics where absent, then vacuumdb --all --analyze-only to refresh cumulative statistics. Plan these commands into the maintenance window and compare important query plans after cutover.

Serkan Arabaci describes a three-node HA PostgreSQL 14-to-18 upgrade using pg_upgrade, including connection draining, --check, and post-upgrade statistics refresh and replica rebuild. Greg Sabino Mullane's PG 12-to-16 walkthrough recommends application testing, release-note review, a backup, a check run, and post-upgrade extension and replica work, and warns there is no easy return after the new cluster starts.

Dump and restore

Use the newer-version pg_dump/pg_dumpall for the dump, since they include improvements. This path is portable but time-consuming. Validate ownership, grants, extensions, and data. Time the dump/restore on a representative copy to establish the maintenance-window requirement.

Logical replication

Logical replication supports cross-major replication and can reduce the final outage to a switchover after synchronization. Published tables that replicate UPDATE or DELETE need a usable replica identity: a primary key, a qualifying unique index, or REPLICA IDENTITY FULL. Insert-only tables do not require one. Monitor replication-slot WAL retention. DDL and large objects are not replicated, and the target schema must accept the incoming rows, though it need not be identical. A PostgreSQL 14 publisher cannot use PostgreSQL 19's sequence-synchronization feature, so copy or advance sequence values separately before cutover.

Rollback is a design decision, not a button

A filesystem or volume snapshot can preserve a pre-upgrade rollback copy if it is taken before pg_upgrade changes the old cluster and is consistent across the complete cluster. Include WAL and every tablespace, even when they reside on separate volumes. Snapshots of those volumes must represent the same point in time. Test restoration of the snapshot before treating it as a rollback path.

With pg_upgrade link mode, do not plan to restart the old cluster after the new cluster has written to shared files. Clone mode or a filesystem snapshot can preserve an old data copy, but neither reconciles writes accepted by the new server. For logical replication, a reverse replication path is not automatic. Decide how post-cutover writes would be recovered. Define the point at which writes stop, what data can be lost or replayed, and an abort threshold before cutover begins.

PostgreSQL database upgrade rollback workflow showing cutover to new-cluster writes, abort decision, post-cutover write recovery or replay, pre-upgrade rollback copy, and database switchback process to prevent data loss during an upgrade rollback.

GitLab's PostgreSQL 9.6-to-11 upgrade retained old-version nodes as a rollback fallback but reported approximately two hours of downtime and four hours total. The retained old nodes did not mean the upgraded data directory itself could be rolled back.

Method Downtime profile Rollback boundary Key prerequisite
pg_upgrade (copy mode) Proportional to data size Old cluster preserved, but writes accepted by the new cluster require recovery before rollback Matching initdb settings (checksums, locale) and all target-version extension libraries installed
pg_upgrade (link/clone mode) Faster. Link shares files, while clone depends on filesystem Link: old cluster unusable after new cluster writes. Clone: old cluster preserved if filesystem supports it, but new-cluster writes require recovery before rollback Same as copy, plus filesystem support verification for clone
Dump / restore Full export and import, with duration established by rehearsal Old cluster preserved, but writes accepted by the new cluster require recovery before rollback Target-version dump tools and storage for the dump and restored target, whether local or remote
Logical replication Final switchover after sync, with duration depending on connection drain and cutover work Old cluster available until decommissioned. Post-cutover writes require recovery, and reverse replication is not automatic Usable replica identity for published UPDATE/DELETE and a target schema compatible with incoming rows. Monitor slot WAL retention. Handle DDL, large objects, and sequence values separately for a PG 14 publisher.

PostgreSQL upgrade preflight-to-rollback checklist

Rehearse each upgrade phase and define an abort threshold before cutover.

  1. Inventory. Record exact PG 14.x minor, OS/libraries, initdb settings, extensions (with each extension's documented version-support matrix for the target version), collations/locales, roles, pg_hba.conf methods, every non-default GUC, clients, backup/replication topology, and operational scripts.
  2. Read all five migration sections. PG 15, 16, 17, 18, and 19 release notes. Diff every removed/renamed GUC and catalog column against configuration management, dashboards, monitoring, and automation.
  3. Back up and prove the restore. Take a recoverable backup and restore it in an isolated environment. Make a representative copy to rehearse the chosen upgrade method. If using a pre-upgrade filesystem or volume snapshot for rollback, capture the complete old cluster, including WAL and tablespaces on other volumes, at a consistent point and test its restore.
  4. Check target-version extensions and, for pg_upgrade, run the preflight check. Install target-version extension libraries and check each extension maintainer's version-support matrix. If using pg_upgrade, use the target version's binary, run pg_upgrade --check, resolve all warnings, and retain the output. A clean check does not certify module or application compatibility.
  5. Test application and SQL behavior. Focus on roles/schema creation, interval/string/JSON parsing, expression-index functions and search_path, text search, CSV import (\.), time-zone input, COPY commands, triggers, collation-sensitive indexes, standard_conforming_strings impact, lock sizing, and JIT. Run regression and integration suites. Compare query plans and workload behavior.
  6. Run the exact cutover procedure and time it. Execute required post-upgrade scripts, module updates, and reindexing. For a PostgreSQL 19 pg_upgrade cutover, most optimizer statistics transfer by default. Generate missing statistics with vacuumdb --all --analyze-in-stages --missing-stats-only, then refresh cumulative statistics with vacuumdb --all --analyze-only as instructed. Compare important query plans and validate data, permissions, replication, monitoring, and application health before removing the old cluster.
  7. Validate rollback path. Keep a tested old cluster, consistent snapshot, or backup available through the rollback decision point. Define the abort threshold and how to recover or replay writes accepted by the new server before switching back.

Frequently asked questions about upgrading PostgreSQL 14 to 19

When did PostgreSQL 14 reach end of life?

PostgreSQL 14 received its final release, 14.25, on November 12, 2026, and is now unsupported. Production clusters need a migration plan to a supported target because newly discovered security vulnerabilities will remain unpatched.

Can I skip intermediate versions and go directly from PostgreSQL 14 to 19?

Yes. pg_upgrade supports upgrades from PostgreSQL 9.2 onward to the current major release. A direct jump does not remove the need to review the migration notes for versions 15, 16, 17, 18, and 19, because behavior changes in each version apply cumulatively to the running cluster.

Does pg_upgrade copy the data files?

It depends on the mode. Copy mode duplicates the data files, which preserves the old cluster but takes longer. Link mode avoids copying files and is fast, but once the new cluster uses shared files the old cluster is not a safe rollback target. Clone mode preserves the old cluster without a full copy if the underlying filesystem supports it.

Does a clean pg_upgrade --check mean the upgrade is safe?

No. The check verifies binary-layout compatibility, matching checksum settings, and some extension presence, but it cannot test application SQL behavior, third-party module ABI compatibility, or query-plan changes. Run the application's regression and integration suites on the upgraded copy.

Do existing databases lose PUBLIC CREATE on the public schema after upgrading to PostgreSQL 15 or later?

Not automatically. The restrictive default applies to newly created databases. Existing databases upgraded via pg_upgrade or restored from a grant-preserving dump retain their old permissions. Audit and revoke explicitly to adopt the new default.

Should I target PostgreSQL 18 or 19?

PostgreSQL 19 offers support through November 2031, and PostgreSQL 18 through November 2030. PostgreSQL 19 shipped on November 19, 2026 and has minimal post-release field history. Specific PG 19 changes weigh on the decision: forced standard_conforming_strings = on requires checking SQL and old dumps that depended on backslash escapes in ordinary string literals, the lock-sizing change requires reviewing any custom max_locks_per_transaction value, and JIT is off by default (impacting analytical workloads that relied on it). Choose 19 if packages, extensions, and workload validation pass and the longer runway is valuable. Choose 18 if the team prefers a release with more operational exposure and those PG 19 changes add unacceptable risk to the timeline. Validate against the exact target's release notes either way.

What happens to optimizer statistics after pg_upgrade?

PostgreSQL 19's pg_upgrade transfers most optimizer statistics unless --no-statistics is used. Some extension and cumulative statistics are not transferred. Run vacuumdb --all --analyze-in-stages --missing-stats-only for relations lacking statistics, then vacuumdb --all --analyze-only as the post-upgrade instructions specify. Allow time to validate important query plans.

Top comments (0)