Skip to content
Shipworthy

PostgreSQL 19: what is new and what breaks on upgrade

PostgreSQL 19 adds REPACK, plan advice and WAIT FOR LSN, and turns JIT off by default. What changed, what can block pg_upgrade, and where you can run it.

By · · 14 min read


PostgreSQL 19 was released on 19 November 2026. The headline features are a REPACK command that can rebuild a bloated table while it stays in use, two modules for steering the query planner, and a WAIT FOR LSN command that gives you read-your-writes on a replica. It also changes more defaults than usual: JIT compilation is now off, one I/O setting is gone, and a few things will stop pg_upgrade before it starts.

This post covers what is new, with the caveats the documentation attaches to each feature, then what can break on upgrade, and where you can run version 19 today.

The release in one table

Version19.0, released 19 November 2026
Supported until19 November 2031
First scheduled minor release11 February 2027
Upgrade pathspg_upgrade, dump and restore, or logical replication
Just went end-of-lifePostgreSQL 14, whose final release was 14.25 on 12 November 2026

The date moved. On 28 September the release team gave 29 October as the planned date. The release candidate announcement of 15 October changed that: the 12 November update release "will include a large number of fixes", so "the release team decided to include these fixes in PostgreSQL 19 before its general availability." A second release candidate shipped on 12 November and the final release followed a week later.

REPACK: one command for rebuilding tables

Until now, getting disk space back from a bloated table meant VACUUM FULL, and physically reordering a table by an index meant CLUSTER. Both lock the table completely while they run, which is why many teams use external tools such as pg_repack instead.

Version 19 folds both into one command. The release notes say: "The two former commands did similar things, but with confusing names, so unify them as REPACK. The old commands have been retained for compatibility."

REPACK employees;
REPACK employees USING INDEX employees_ind;
REPACK (CONCURRENTLY) employees USING INDEX;

Those three lines are from the REPACK documentation. The third form is the new capability. With CONCURRENTLY, the documentation says, "the bulk of the operation is run with SHARE UPDATE EXCLUSIVE lock, and the ACCESS EXCLUSIVE lock is only acquired during the final phase to swap the table and index files." Changes made in the meantime are captured with logical decoding and applied before that final lock.

The announcement describes this as repacking "without blocking reads and writes". The documentation is more careful, and the fine print matters:

  • There is still an exclusive lock at the end. The documentation says it is "typically held for a short time, depending on the amount of changes accumulated while the lock was being waited for."
  • It is not MVCC-safe. In the documentation's words: "After the repacking transaction commits, the table will appear empty to concurrent transactions, if they are using a snapshot taken before repacking started." A long-running report that started before the repack can see an empty table.
  • It needs disk space. REPACK "creates a temporary copy of the table and all of its indexes, so you need free disk space at least equal to the sum of the table size and the index sizes."
  • It needs a replication slot. A new setting, max_repack_replication_slots, controls how many. The default is 5 and it can only be set at server start.
  • It can fail under heavy churn. The documentation says that "if more than about 104 million rows are concurrently updated or deleted during the execution of REPACK, the command fails."
  • It does not work everywhere. The documentation lists cases where CONCURRENTLY cannot be used, including when the table is partitioned, is UNLOGGED, "lacks a primary key and index-based replica identity", or when the command is run inside a transaction block.

Progress is visible in a new pg_stat_progress_repack view, and the command needs the MAINTAIN privilege on the table.

Plan advice: steering the planner, carefully

PostgreSQL has long declined to add query hints of the kind other databases have. Version 19 ships something close, as two modules written by Robert Haas.

pg_plan_advice lets you describe planner decisions in a small language, see the advice that corresponds to the plan the planner chose, and feed advice back in. EXPLAIN with the new PLAN_ADVICE option prints lines such as JOIN_ORDER(f d) or HASH_JOIN(d). To apply advice for a session:

SET pg_plan_advice.advice = 'JOIN_ORDER(f d)';

The advice language covers scan methods, join order, join methods and parallelism. The documentation states the limit: "it operates by constraining the planner's choices, not by replacing it. Therefore, no matter what advice you provide, you will only ever get a plan that the core planner would have considered for the query in question." You cannot yet control aggregation, and the page says so.

pg_stash_advice is the part that makes this usable in production. It stores advice against query identifiers and applies it automatically: "Whenever a session is asked to plan a query whose query ID appears in the relevant advice stash, the plan advice string is automatically applied to guide planning." So a query with a known-bad plan can be pinned without changing application code.

Three warnings are in the documentation itself:

  • It can make things worse. "Note that, since the planner often makes good decisions, overriding its judgment can easily backfire."
  • It has a cost even when it changes nothing. The pg_stash_advice page says that "applying plan advice can have a noticeable performance cost even when it does not result in a change to the query plan."
  • The stash is not private. The page says pg_stash_advice "currently lacks a sophisticated security model", and that "Users should assume that information embedded in stashed advice strings may become visible to non-privileged users."

Both need loading before use. pg_plan_advice is loaded through shared_preload_libraries, session_preload_libraries or LOAD. pg_stash_advice also needs CREATE EXTENSION.

WAIT FOR LSN: read your own writes on a replica

If your application writes to the primary and reads from a standby, a user can save a change and then not see it, because the standby has not replayed it yet. The usual workarounds are to read from the primary for a while, or to poll.

Version 19 adds a command for it. After a write, the application takes the primary's current position in the write-ahead log, then asks the standby to wait until it has caught up:

WAIT FOR LSN '0/0306EE20';
WAIT FOR LSN '0/0306EE20' WITH (MODE 'standby_write', TIMEOUT '100ms', NO_THROW);

Both lines are from the WAIT documentation. The command returns success, timeout or not in recovery. The restrictions are specific: it "must be executed as a top-level command", so not from a function, procedure or DO block, and the documentation advises running it "outside a transaction block, or as the first statement of one". The application or the connection pooler has to carry the position from the write to the read. The database does not do that part.

Logical replication gets easier to turn on

Two changes here remove long-standing friction.

No restart to enable it. Logical replication used to require wal_level = logical, a setting that only changes at server start. In version 19, with wal_level at replica, the system "automatically increases the effective WAL level to logical when creating the first logical replication slot, and decreases it back to replica when dropping or invalidating the last logical replication slot." A new effective_wal_level setting reports the current state.

Sequences are replicated. Sequence values did not follow the data before, which made cut-overs awkward: after switching to the subscriber, sequences had to be advanced by hand. Publications can now include them:

CREATE PUBLICATION all_sequences FOR ALL SEQUENCES;
CREATE PUBLICATION all_tables_except FOR ALL TABLES EXCEPT (TABLE users, departments);

The second line shows another addition, an EXCEPT clause for excluding tables from an ALL TABLES publication.

Smaller things worth knowing

  • INSERT ... ON CONFLICT DO SELECT. An upsert can now return the existing row on conflict, optionally locking it. The release notes say it "allows conflicting rows to be returned, and optionally locked with FOR UPDATE/SHARE." A RETURNING clause is required. That removes a common insert-or-fetch round trip.
  • IGNORE NULLS for window functions, supported for lead(), lag(), first_value(), last_value() and nth_value().
  • COPY TO can write JSON, and can output a single JSON array with the FORCE_ARRAY option.
  • EXPLAIN ANALYZE gets an IO option to report asynchronous I/O activity.
  • Autovacuum can vacuum indexes in parallel, but not by default. The limit, autovacuum_max_parallel_workers, defaults to 0, which disables it. Autovacuum also now picks which table to process next with a scoring system, where it used to follow catalog order.
  • Lock waits are logged by default. log_lock_waits is now on.

On performance, the project gives one number. The press kit says the release "improves the performance of foreign key checks, which in testing made bulk inserts nearly 2x faster". It gives no hardware, dataset or method, so treat it as a direction and measure your own workload. The other improvements in the notes, such as radix sort and SIMD parsing for COPY FROM, come without figures.

What is not in 19

SQL/PGQ, the standard's syntax for property graph queries, was in the beta. It was reverted from the 19 branch on 7 September, in a commit that deleted more than 15,000 lines. The release management team's reasoning, posted by Melanie Plageman, was that there were "serious concerns about the number of design issues", and that reverting "would make it easier to fix these things properly in 20 without having to be burdened by backwards compatibility and backpatching."

If you read a preview of PostgreSQL 19 from the summer that promised graph queries, that part did not ship.

What can break when you upgrade

The release notes' migration section is longer than usual. These are the entries most likely to matter, grouped by what they do to you.

Things that stop pg_upgrade

WhatWhySource wording
btree_gist indexes on inet or cidr columnsThe old operator classes can return wrong results"pg_upgrade will disallow upgrading of clusters with btree_gist inet/cidr indexes."
Database, role or tablespace names containing a carriage return or line feedNow disallowed"pg_upgrade will also disallow upgrading of clusters that use such names."
Databases using the MULE_INTERNAL encodingThe encoding is removed"Databases using it will need to be dumped and restored with a different encoding."

Defaults and settings that changed

  • JIT is off by default. The notes explain: "Previously JIT was enabled by default, and activated based on optimizer costs, but this costing has been determined to be unreliable. This change requires sites that are doing many large analytical queries to manually enable JIT." If analytical queries get slower after the upgrade, check this first.
  • io_workers is removed. It is replaced by io_min_workers, io_max_workers, io_worker_idle_timeout and io_worker_launch_interval, and the worker count now scales by itself. A leftover io_workers line in a configuration file refers to a setting that no longer exists, so remove it before you start the new server.
  • max_locks_per_transaction defaults to 128, up from 64. The notes add that "effectively settings must now be doubled to match their capacity in previous releases." If you raised it yourself, raise it again.
  • standard_conforming_strings is always on, and escape_string_warning is removed. Dumps made by older versions of pg_dump with the setting off "will not properly load into PostgreSQL 19 and later servers."
  • The default TOAST compression is lz4 where PostgreSQL is built with LZ4 support. Existing data is not rewritten.
  • log_autovacuum_min_duration no longer covers autoanalyze. There is a new log_autoanalyze_min_duration for that. Monitoring that parses these log lines may need a change.

Behaviour that changed

  • RADIUS authentication is removed. The notes say PostgreSQL "only supported RADIUS over UDP, which is unfixably insecure." If pg_hba.conf uses it, you need another method before you upgrade.
  • MD5 passwords now produce a warning after a successful login. MD5 was deprecated in 18. The warning can be turned off with md5_password_warnings, but the direction is clear: move to SCRAM.
  • json_array() over no rows returns an empty array. It used to return NULL. Code that tests for NULL will behave differently.
  • Read-only transactions stay read-only through postgres_fdw. They "can no longer modify rows processed by postgres_fdw sessions."
  • Parallel VACUUM with cost-based delay "might run slower than in previous releases", because the leader and workers now share one delay limit.
  • Some monitoring names changed. sync_error_count in pg_stat_subscription_stats is now sync_table_error_count, and several buffer wait events were renamed or split. Dashboards and alerts that use the old names will go quiet.

Things to reindex

Two entries recommend a reindex after pg_upgrade: indexes that use full text search or pg_trgm in databases with a non-libc locale provider, and indexes that use fuzzystrmatch functions, which now handle non-ASCII characters differently. Several full text stemmers also changed, the Dutch one most of all, and "produce different stems for some words". The notes attach no reindex advice to that one, but stored tsvector values built with the old stemmer will not match new queries in the same way.

Checks you can run on the old server

These are my own, standard queries and not from the release notes. They are a starting point for the items above, not a complete audit:

SHOW jit;
SHOW max_locks_per_transaction;
SELECT datname, pg_encoding_to_char(encoding) FROM pg_database;
SELECT rolname FROM pg_authid WHERE rolpassword LIKE 'md5%';  -- superuser only

Then search pg_hba.conf for radius and postgresql.conf for io_workers, and run pg_upgrade --check against a copy of the cluster. It tests compatibility without changing any data.

Should you upgrade now?

The documentation lists three ways to move: pg_upgrade, dump and restore, and logical replication. pg_upgrade supports source versions back to 9.2.

Timing is your call, and two facts bear on it. First, 19.0 is the only release so far. The next scheduled minor release is 11 February 2027, and plenty of teams wait for a .1 before moving production. Second, if you are still on PostgreSQL 14, waiting is no longer free. The 12 November announcement says: "PostgreSQL 14 is now end-of-life and will no longer receive security and bug fixes." You do not have to jump to 19 to fix that, since 15 through 18 are all supported, but you do have to move.

Where you can run it

From each provider's own statement, as I found them on 27 November:

ProviderStatusSource
NeonAvailable since release day, including on the free plan. Not all extensions yetNeon's blog, 19 Nov
Amazon RDSPostgreSQL 19.0 in the Database Preview Environment only, where clusters are kept for at most 60 daysAWS announcement, 23 Nov
Azure Database for PostgreSQLPreview, in the East Asia region onlyAzure release notes, November 2026
Google Cloud SQL, SupabaseI found no PostgreSQL 19 entry in either provider's release notesChecked 27 Nov

Neon's post adds its own caution: "Keep production on your current version until you're comfortable with the results." None of the three large clouds has announced a production date.

The short version

  • Released: PostgreSQL 19.0 on 19 November 2026, three weeks later than first planned. Supported until November 2031.
  • Headline features: REPACK with a CONCURRENTLY option, pg_plan_advice and pg_stash_advice for steering the planner, WAIT FOR LSN for read-your-writes on standbys, logical replication without a restart, and replication of sequences.
  • Read the fine print: concurrent repack still takes a brief exclusive lock, is not MVCC-safe and needs a primary key and a replication slot. Plan advice can backfire and its stash is not private.
  • Not included: SQL/PGQ property graph queries, reverted in September and aimed at version 20.
  • Before you upgrade: JIT is off by default, io_workers and RADIUS are gone, max_locks_per_transaction needs doubling if you set it, and pg_upgrade refuses btree_gist indexes on inet or cidr.
  • If you are on 14: it is end-of-life as of 12 November. Plan a move to a supported version.
  • Managed services: Neon has it. RDS and Azure have previews. Nothing yet from Google Cloud SQL or Supabase.

If your application reaches Postgres through an AI coding agent or a generated backend, the upgrade checks above are yours to run, not the tool's. The post on data exposed by generated apps shows what gets missed when nobody owns the database settings.

Frequently asked questions

When was PostgreSQL 19 released?

On 19 November 2026, as version 19.0. The release was first planned for 29 October and moved so that it could include the fixes from the 12 November update release. PostgreSQL 19 is supported until 19 November 2031.

Does REPACK replace VACUUM FULL and CLUSTER?

Yes, according to the release notes, which say REPACK replaces both and that the old commands are retained for compatibility. The new part is REPACK (CONCURRENTLY), which rebuilds a table while reads and writes continue and takes its exclusive lock only for the final swap.

Is REPACK CONCURRENTLY completely non-blocking?

No. The documentation says the bulk of the work runs under a SHARE UPDATE EXCLUSIVE lock and an ACCESS EXCLUSIVE lock is still taken in the final phase to swap the files. It is also not MVCC-safe, needs a primary key or replica identity index, and cannot be used on partitioned or unlogged tables.

What breaks when upgrading to PostgreSQL 19?

The main ones from the release notes: JIT is now off by default, the io_workers setting is removed, RADIUS authentication is removed, standard_conforming_strings is always on, and json_array() with no rows returns an empty array instead of NULL. pg_upgrade refuses clusters that have btree_gist indexes on inet or cidr columns, or names containing line breaks.

Does PostgreSQL 19 have SQL/PGQ property graph queries?

No. The feature was in the beta and was reverted from the 19 branch on 7 September 2026. The release management team said it had concerns about unresolved design issues and that it would be easier to fix them properly in version 20.

Get The Shipping Forecast

One email on Thursdays: what I tested and wrote that week, plus one tool worth your time.

You'll get a confirmation email first. Unsubscribe in one click. Privacy policy.