<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan" -->

---
title: PostgreSQL 19: new features, planner changes, and what...
description: PostgreSQL 19 ships without one headline feature, focusing instead on operator control and planner changes. REPACK (CONCURRENTLY) reclaims table bloat without...
canonical: https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: PostgreSQL 19: new features, planner changes, and what to test before upgrading | daily.dev
og:description: PostgreSQL 19 ships without one headline feature, focusing instead on operator control and planner changes. REPACK (CONCURRENTLY) reclaims table bloat without...
og:url: https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan
og:image: https://api.daily.dev/og/posts/8Wx1vizan.png
og:image:alt: PostgreSQL 19: new features, planner changes, and what to test before upgrading
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL 19: new features, planner changes, and what to test before upgrading

**[Collections](https://daily.dev/sources/collections)** · 3 min read · 1 upvotes · 0 comments

## Summary

PostgreSQL 19 ships without one headline feature, focusing instead on operator control and planner changes. REPACK (CONCURRENTLY) reclaims table bloat without blocking reads or writes. New extensions pg_plan_advice and pg_stash_advice let you stabilize or override a bad query plan. WAIT FOR LSN gives read-your-writes consistency on replicas, autovacuum can now vacuum indexes in parallel, and faster foreign key checks made bulk inserts nearly 2x faster in testing. JIT compilation is now disabled by default. The planner also changes enough that identical queries can run with different plans, and text search behavior shifts for pg_trgm and non-ASCII input, so trigram indexes may need reindexing after upgrade.

## Content

PostgreSQL 19 is out. Neon supported it on launch day, and pgEdge packages were available the same day. There's no single headline feature. The release is mostly about giving operators more control, and a few of the changes can alter how your existing queries behave.

## What's new

**REPACK.** The new REPACK command replaces VACUUM FULL and CLUSTER. With CONCURRENTLY, it reclaims table bloat and reorders rows while reads and writes continue. In one test, inserts held at about 2,000 a second during a sub-second rebuild.

**Plan control.** The pg_plan_advice extension lets you stabilize query plans or try alternatives, and pg_stash_advice helps override bad plans. pg_stat_statements now also tracks generic versus custom plan counts.

**Replication.** Logical replication no longer needs a server restart to enable. It can publish sequences with ALL SEQUENCES, and a retain_dead_tuples option supports conflict detection. The new WAIT FOR LSN command blocks a standby until it has replayed a given WAL position, which gives you read-your-writes consistency and avoids stale reads.

**Autovacuum.** It can now vacuum indexes in parallel, controlled by autovacuum_max_parallel_workers, and it ranks tables with a scoring system.

**Smaller additions.** ON CONFLICT DO SELECT handles get-or-create patterns, COPY TO can output JSON, and postgres_fdw can import statistics. Faster foreign key checks made bulk inserts nearly 2x faster in testing.

**Changed defaults.** JIT is now off. max_locks_per_transaction is 128. The transaction wraparound warning starts at 100 million transactions instead of 40 million.

Several planned features, including SQL/PGQ graph queries and GROUP BY ALL, were reverted before release over correctness or design concerns.

## Planner changes that can shift your plans

The uncomfortable part of any upgrade is that SQL can keep working while its execution plan changes. Sometimes that's harmless. Sometimes a 100ms index scan turns into a 2-second join. The reverse happens too: a 500ms sequential scan can drop to 80ms.

PostgreSQL 19 changes the planner in several ways:

- More NOT IN expressions become anti-joins when NULLs are provably absent.
- More LEFT JOIN patterns are turned into anti-joins.
- Memoize caching extends to anti-joins.
- Aggregation can happen earlier, before joins.
- Semijoin and incremental-sort planning are improved.
- Hash joins handle NULL join keys more efficiently.
- New optimizer statistics cover Boolean functions and virtual generated columns.

## Text search and locale

Character classification used by pg_trgm has changed, and full-text search, pg_trgm and fuzzystrmatch handle locale information and non-ASCII characters differently. If you rely on trigram indexes, validate them after upgrading and be ready to reindex. Test search with misspellings and different casing.

## Testing before production

1. Identify your critical queries and record current extensions and their versions.
2. Enable pg_stat_statements on the current system to capture baseline stats.
3. Build a separate test environment, for example with Docker, loaded with production-like data. Make sure statistics are fresh.
4. Capture EXPLAIN (ANALYZE, BUFFERS) output on both versions and compare plans.
5. Test the pg_dump/pg_restore migration path.
6. Run full application workflows through your real drivers, such as Npgsql, not just raw SQL.
7. After deployment, watch latency before concluding the planner regressed.

If a plan does regress, pg_plan_advice and pg_stash_advice give you a way to pin it down.

## Security updates

Separately, the November 12 updates for PostgreSQL 18.7, 17.12, 16.16 and 15.20 fixed 52 security vulnerabilities and more than 140 bugs, including incremental backup corruption fixes.

## Questions this post answers

### What new features does PostgreSQL 19 add for managing table bloat and query plans?

PostgreSQL 19 adds REPACK (CONCURRENTLY), which reclaims table bloat and reorders rows while reads and writes continue. It also introduces two extensions, pg_plan_advice and pg_stash_advice, which let you stabilize a query plan or try alternatives instead of rewriting the query when the planner picks a bad plan.

_Teams planning a postgresql 19 upgrade can track planner-affecting changes like these on daily.dev._

### Why did my PostgreSQL query plans change after upgrading to PostgreSQL 19 even though the SQL didn't change?

PostgreSQL 19 changes planner behavior so that more NOT IN expressions and LEFT JOIN patterns become anti-joins, memoize caching extends to anti-joins, aggregation can happen before joins, and hash joins handle NULL join keys more efficiently. These changes can turn a 500ms sequential scan into an 80ms index scan, or turn a 100ms index scan into a 2-second join.

_Developers debugging plan regressions after a postgresql upgrade can follow coverage of these planner shifts on daily.dev._

### How much faster are bulk inserts in PostgreSQL 19 compared to previous versions?

Bulk inserts ran nearly 2x faster in testing on PostgreSQL 19, due to faster foreign key checks. This is one of several performance-related changes in the release, alongside parallel index vacuuming controlled by autovacuum_max_parallel_workers and JIT compilation now being disabled by default.

_Anyone benchmarking a postgresql version upgrade can follow these performance figures on daily.dev._

## Similar posts on daily.dev

- [PostgreSQL 19 Beta Introduces SQL Graph Queries and Concurrent Table Repacking](https://daily.dev/posts/postgresql-19-beta-introduces-sql-graph-queries-and-concurrent-table-repacking-2adopzbmz) · InfoQ · 90 upvotes · 4 comments
- [Waiting for PostgreSQL 19 – Introduce the REPACK command – select \* from depesz;](https://daily.dev/posts/waiting-for-postgresql-19-introduce-the-repack-command-select-from-depesz--naffqzlbk) · depesz · 27 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#full-text-search](https://daily.dev/tags/full-text-search)

[View this post on daily.dev](https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"PostgreSQL 19: new features, planner changes, and what to test before upgrading","url":"https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan"},"datePublished":"2026-11-19T16:41:30.058Z","dateModified":"2026-11-19T18:08:22.205Z","description":"PostgreSQL 19 ships without one headline feature, focusing instead on operator control and planner changes. REPACK (CONCURRENTLY) reclaims table bloat without...","isAccessibleForFree":true,"articleSection":"Collections","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collections","logo":"https://media.daily.dev/image/upload/s--fk_6ycEi--/f_auto,q_auto/v1780996001/logos/collections?_a=BAMAMiWQ0","url":"https://daily.dev/sources/collections"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,postgresql,full-text-search","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collections","item":"https://daily.dev/sources/collections"},{"@type":"ListItem","position":3,"name":"PostgreSQL 19: new features, planner changes, and what to test before upgrading"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/postgresql-19-new-features-planner-changes-and-what-to-test-before-upgrading-8wx1vizan#faq","mainEntity":[{"@type":"Question","name":"What new features does PostgreSQL 19 add for managing table bloat and query plans?","acceptedAnswer":{"@type":"Answer","text":"PostgreSQL 19 adds REPACK (CONCURRENTLY), which reclaims table bloat and reorders rows while reads and writes continue. It also introduces two extensions, pg_plan_advice and pg_stash_advice, which let you stabilize a query plan or try alternatives instead of rewriting the query when the planner picks a bad plan. Teams planning a postgresql 19 upgrade can track planner-affecting changes like these on daily.dev."}},{"@type":"Question","name":"Why did my PostgreSQL query plans change after upgrading to PostgreSQL 19 even though the SQL didn't change?","acceptedAnswer":{"@type":"Answer","text":"PostgreSQL 19 changes planner behavior so that more NOT IN expressions and LEFT JOIN patterns become anti-joins, memoize caching extends to anti-joins, aggregation can happen before joins, and hash joins handle NULL join keys more efficiently. These changes can turn a 500ms sequential scan into an 80ms index scan, or turn a 100ms index scan into a 2-second join. Developers debugging plan regressions after a postgresql upgrade can follow coverage of these planner shifts on daily.dev."}},{"@type":"Question","name":"How much faster are bulk inserts in PostgreSQL 19 compared to previous versions?","acceptedAnswer":{"@type":"Answer","text":"Bulk inserts ran nearly 2x faster in testing on PostgreSQL 19, due to faster foreign key checks. This is one of several performance-related changes in the release, alongside parallel index vacuuming controlled by autovacuum_max_parallel_workers and JIT compilation now being disabled by default. Anyone benchmarking a postgresql version upgrade can follow these performance figures on daily.dev."}}]}
```

