# PostgreSQL 19 halves foreign-key insert overhead and replaces pg_repack

Original title: What Changes When You Upgrade from PostgreSQL 18 to 19

> Hacker News story 50658063 · language: en · submitted 2026-11-26
> Web version: https://zeli.app/story/50658063
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 112 · by [rgoomar](<https://news.ycombinator.com/user?id=rgoomar>) · 💬 32
[original](<https://rishigoomar.com/postgresql-19-what-changes-when-you-upgrade-from-18>) · [HN discussion](<https://news.ycombinator.com/item?id=50658063>)

## Summary

I benchmarked PostgreSQL 18.6 against 19.0 on real workloads. Batch inserts into foreign-key tables dropped 41% (202ms to 119ms) because 19 checks the parent's unique index directly. NOT IN queries now use a hash anti join, cutting 24.5% off a missing-ID count. The new REPACK (CONCURRENTLY) command reclaimed over half a table's disk space without blocking reads or writes, replacing pg_repack for most jobs. Also covered: pg_plan_advice for plan hints, ON CONFLICT DO SELECT, and WAIT FOR LSN for replica consistency.

## Key quote

> If you subtract the no-foreign-key baseline, the extra overhead of the foreign-key check itself fell roughly in half, from around 155 ms to 74 ms.

## HN discussion (32 comments)

### [gwking](<https://news.ycombinator.com/item?id=50683284>)

> I am surprised that "an already-open transaction that reads events for the first time after the swap can see an empty table" is considered acceptable.
>
> I am not a Postgres user, and I appreciate that production databases are complicated beasts. Do people who use Postgres for production think this sounds fine?

### [yuuch](<https://news.ycombinator.com/item?id=50663562>)

> From an app dev perspective, 19 feels pretty quiet—especially since SQL/PGQ and GROUP BY ALL got pushed out to 20.
>
> For ops, though, it's a huge quality-of-life release. Built-in REPACK (CONCURRENTLY), turning on logical replication without a restart, and turning JIT off by default finally fix some of the biggest day-to-day operational headaches without needing external extensions or workarounds.

### [Scaled](<https://news.ycombinator.com/item?id=50684816>)

> I can always tell when a new postgres comes out because one of my docker powered apps just breaks (just a selfhosted one, nothing actually important).  The official docker for postgres attempts to do no auto update between versions and you're basically left to go figure it out yourself when `latest` breaks itself.  This is by design, apparently.
>
> I know there's an argument for version pinning, but I don't want to have to handhold random docker containers.  It should be automated IMO.  It's become a deterrent for me wanting to deploy anything that depends on postgres.

---

## Cite

- Page: https://zeli.app/story/50658063
- Date: 2026-11-26
- Source: rishigoomar.com (https://rishigoomar.com/postgresql-19-what-changes-when-you-upgrade-from-18)
- Hacker News: https://news.ycombinator.com/item?id=50658063

## Other languages

- zh: https://zeli.app/zh/story/50658063 · markdown: https://zeli.app/zh/story/50658063.md
- ja: https://zeli.app/ja/story/50658063 · markdown: https://zeli.app/ja/story/50658063.md
- ko: https://zeli.app/ko/story/50658063 · markdown: https://zeli.app/ko/story/50658063.md
- de: https://zeli.app/de/story/50658063 · markdown: https://zeli.app/de/story/50658063.md
- es: https://zeli.app/es/story/50658063 · markdown: https://zeli.app/es/story/50658063.md
- ru: https://zeli.app/ru/story/50658063 · markdown: https://zeli.app/ru/story/50658063.md
