PostgreSQL 19 is out with REPACK (CONCURRENTLY), pg_plan_advice query hints, WAIT FOR LSN, and more. Here's what actually matters for developers.
Vamsi Tallapudi
Manager, Architect Technology at Cognizant
PostgreSQL 19 shipped on November 19, 2026, and it's one of those releases where the changelog reads like a wishlist the community has been filing for a decade. REPACK finally gives you a non-blocking way to shrink bloated tables. pg_plan_advice lets you tell the planner what to do without changing your query. WAIT FOR LSN fixes the "I just wrote this row, why can't my replica see it" problem. None of these are flashy AI features. They're the kind of thing a DBA emails you about at 2am, which is exactly why they matter.
I pulled this from the official release notes, the press kit, and the Hacker News thread where people actually argued about it, because PostgreSQL release announcements are notoriously dry and the real opinions live in the comments.
Five changes stand out if you run Postgres in production: REPACK (CONCURRENTLY), the pg_plan_advice extension, WAIT FOR LSN, INSERT ... ON CONFLICT DO SELECT, and JIT being disabled by default. There's a long tail of smaller stuff too (parallel autovacuum, logical replication of sequences, JSON output from COPY), and I'll get to those. But these five are what you'll actually touch.
Fun side note: the release was supposed to land in October and slipped to November. According to committer Peter Eisentraut, AI-assisted code review during beta surfaced more bugs than the usual process catches, so the team pulled eight to ten features rather than ship them half-baked. Kind of funny that the thing slowing down a database release in 2026 is "the robots found too many bugs."
If you've ever run VACUUM FULL on a production table and watched your app lock up, you know why this is the headline feature. VACUUM FULL and CLUSTER both rebuild the table to reclaim bloat, but they take an exclusive lock for the entire operation. On a big table that's minutes of downtime, sometimes longer.
REPACK replaces both commands (they're still around for compatibility, but nobody should reach for them anymore). The regular REPACK behaves similarly to the old tools. The one you actually want is REPACK (CONCURRENTLY):
SHARE UPDATE EXCLUSIVE lock for the bulk of the rebuild, the same level VACUUM and ANALYZE already useCLUSTER used to doThis is the feature I'd actually push for first if I were running a fleet of Postgres databases. Bloat cleanup has always meant choosing between "live with the bloat" or "schedule a maintenance window." Now you mostly don't have to choose.
For twenty years, the Postgres project's official position on query hints was "no, and we mean it." The argument was always that hints get stale as your data changes, and then you're stuck with a plan that used to be good and now actively hurts you. That argument was correct, and also increasingly unpopular with anyone running Postgres at scale next to Oracle or SQL Server, where hints have existed forever.
pg_plan_advice is the compromise, and it's a clever one. You don't write hints by hand. Instead you run EXPLAIN (PLAN_ADVICE) on a query that's using a good plan, and it hands you back a string describing the decisions the planner made: join order, scan method, whether to use a gather node. Something like:
SET pg_plan_advice.advice = 'JOIN_ORDER(e t) INDEX_SCAN(t idx_orders_customer)';
The companion extension, pg_stash_advice, stores that string and automatically reapplies it to future executions of the same query, matched by query ID — so you can stabilize a plan without touching application code. There's also a feedback mode (pg_plan_advice.feedback_warnings) that tells you when the advice no longer matches reality, which is the part that actually addresses the original "hints go stale" objection.
My honest take: this is the right way to do it. It's not a free-text hint syntax where you're guessing at semantics. It's generated from an actual plan, and it tells you when it's lying to you. I was skeptical going in, given how long Postgres held the line on this, but the design holds up.
This one solves a specific, annoying problem. You write a row on the primary, then immediately read it back from a replica for a redirect or confirmation page, and sometimes it's not there yet because replication lag is real. Developers have been hacking around this with sleeps, sticky sessions, or just routing the read back to the primary and eating the extra load.
WAIT FOR LSN lets a session on a standby block until replication has caught up to a specific log sequence number (LSN) — the position in the write-ahead log tied to your write — before running the next query. You get the write's LSN back from the primary, hand it to the replica, and the replica waits for you.
It's not magic. The Hacker News crowd pointed out, fairly, that for simple cases a RETURNING clause on your original write is often just as good and simpler. But for apps that genuinely fan reads out across replicas, this is the first real primitive Postgres has given you for read-your-writes consistency instead of rolling your own.
"Get or create" is one of the most common patterns in application code — try to insert a row, and if it already exists, fetch the existing one instead. Doing this in two statements means a round trip and a race condition window. People have worked around it with INSERT ... ON CONFLICT DO NOTHING RETURNING * followed by a fallback SELECT, which is clunky and still two queries half the time.
INSERT ... ON CONFLICT DO SELECT does it in one shot. The RETURNING clause now returns the conflicting existing row when the insert doesn't happen, so you always get a row back, no fallback query needed. Small feature, but it's the kind of thing that shows up in nearly every web app's user-signup or tag-creation code, so the aggregate savings across an ecosystem add up.
PostgreSQL 18 and earlier turned on JIT compilation for queries the planner estimated as "expensive enough to be worth it." The problem is those cost estimates were unreliable, and plenty of people got bitten by JIT kicking in on a query that didn't need it, adding compilation overhead for no benefit. If you've read our piece on Python dropping its JIT in PEP 836, you'll recognize the pattern: a JIT that fires on bad heuristics is worse than no JIT at all.
PostgreSQL 19 disables JIT by default. If you run heavy analytical workloads with genuinely expensive queries, turn it back on explicitly. For everyone else, this just removes a footgun. One Hacker News commenter put it bluntly: "That was long overdue. The performance impact on perfectly tuned queries was horrendous." I agree, and I'd guess a decent chunk of "random Postgres slowdown" support tickets over the past few years trace back to exactly this.
None of these are headline features, but they'll matter to the right team:
| Feature | What it does |
|---|---|
autovacuum_max_parallel_workers | Lets autovacuum parallelize index vacuuming on busy tables |
| Logical replication of sequences | CREATE PUBLICATION ... FOR ALL SEQUENCES finally covers sequence values |
| Automatic WAL level promotion | Creating a logical replication slot now raises WAL level without a restart |
postgres_fdw import_stats | Pulls real statistics from the remote server instead of sampling rows |
COPY to JSON | Can output query results as JSON, including as a single array |
pg_stat_lock, pg_stat_recovery, pg_stat_autovacuum_scores | New monitoring views for lock contention, recovery status, and vacuum prioritization |
| Foreign key check speedup | Bulk inserts into tables with FK constraints are close to 2x faster in testing |
SNI support (pg_hosts.conf) | One Postgres server can present different TLS certs per hostname |
| RADIUS authentication | Removed entirely |
If you're running Supabase or anything else that layers auth and row-level security on top of Postgres, the SNI and md5-deprecation changes are worth a skim even if you never touch raw SQL. We covered a related RLS misconfiguration risk in our Supabase RLS leak check piece — the underlying database keeps getting more capable, but it doesn't save you from a bad policy.
Jonathan Katz, a PostgreSQL Core Team member, summed up the release this way: "PostgreSQL 19 continues that commitment to reliability, giving users new ways to manage their workloads without disruption and to build applications that span multiple systems." That's a fair description. This isn't a release built to win benchmark headlines — it's a release built so you stop needing maintenance windows and workaround scripts.
Not on day one, no. Wait for 19.1. That's not a knock on this release specifically, it's just how every Postgres major version goes, and the Hacker News thread had the usual contingent of people citing past point-release bugs as a reason to hold off. The EXPLAIN (BUFFERS) crash that got reported during the RC cycle is a good example of the kind of thing that gets found fast once more people are on it.
That said, start planning for it now. If you're fighting table bloat with scheduled VACUUM FULL windows, REPACK alone is worth the upgrade cycle once 19.1 or 19.2 lands. If you've been hand-rolling plan stability with pg_hint_plan or similar third-party extensions, pg_plan_advice being in core is worth evaluating. Everything else here is additive and low-risk.
PostgreSQL 19 is the latest major version of the open source PostgreSQL database, released on November 19, 2026. It shipped about a month later than the usual October cadence after AI-assisted code review during the beta surfaced extra bugs that the team wanted to fix first.
pg_plan_advice is a new extension that lets you capture a query planner's decisions (join order, scan method, and similar choices) as a text string via EXPLAIN (PLAN_ADVICE), then reapply that string to stabilize or adjust future plans. The companion pg_stash_advice extension stores advice and auto-applies it by query ID, so you don't have to edit application code.
VACUUM FULL and CLUSTER both take an exclusive lock on the table for the entire rebuild, blocking reads and writes. REPACK (CONCURRENTLY) holds a much lighter SHARE UPDATE EXCLUSIVE lock for most of the operation and only locks exclusively for a brief final swap, so the table stays usable while bloat is reclaimed.
It gives you read-your-writes consistency when reading from a standby replica. You write to the primary, get back the LSN of that write, then run WAIT FOR LSN on the replica session before your next query — the replica blocks until it has replayed the WAL up to that point, so you're guaranteed to see your own write.
Most teams should wait for a 19.1 or 19.2 point release before migrating production workloads, which is standard practice for any new Postgres major version. Test it in staging first, especially if you rely on JIT compilation (now off by default) or any third-party planner-hint extensions that might interact with pg_plan_advice.
Yes — RADIUS authentication is removed entirely, and md5 password authentication (deprecated since PostgreSQL 18) now logs a warning on every successful login, which you can silence with md5_password_warnings until you migrate to SCRAM. VACUUM FULL and CLUSTER still work but are effectively superseded by REPACK.
New AI tools, automation workflows, and course drops — straight to your inbox. Join 2,400+ builders.
Linger is a free, open-source personal AI agent that runs locally on your PC via its PolyStrata engine, or routes tasks to Claude Code, Codex, or Pi.
Thinking Machines' Inkling 2 Mini is a 26B looped transformer at $0.15/$0.50 per 1M tokens that runs on a 32GB Mac, DGX Spark, or via GGUF on any PC.
Claude Fable 5.2 agents ran unsupervised for six weeks and solved two open black hole physics problems, including a calculation stuck since 2003. Here's how the setup actually worked.
Comments