PostgreSQL 19 landed on November 19, 2026, and it is the first major release in years that changes how you do routine maintenance: REPACK finally replaces the pg_repack extension dance, REPACK (CONCURRENTLY) rewrites a table without blocking reads or writes, and standby reads can now wait for replay with a single WAIT statement. If you are still running 16 or 17, you now have three supported majors to choose from — and each one carries a different upgrade bill.

The trap: upgrading is not the hard part. Choosing the wrong target version is. A cluster you migrate to 19 today is a cluster you will be patching until November 2031. A cluster you keep on 17 has an end-of-life date in November 2029. That gap is worth more than any single feature.

TL;DR

  • Greenfield deployments in late 2026: start on PostgreSQL 19.0. You get REPACK, WAIT, sequence-aware logical replication and roughly five years of support in one move.
  • Production clusters on 16 or 17 with extensions you cannot rebuild: stay put, apply 16.16 or 17.12, and plan the 19 jump as a project rather than a maintenance window.
  • Clusters still on 15 or older: migrate now. You are outside the supported window and every month of delay adds dump/restore time you cannot get back.
  • Never trust an in-place pg_upgrade --link on a cluster with unfamiliar extensions. Test the restore path first.

Version comparison at a glance

PostgreSQL 19PostgreSQL 18PostgreSQL 17
First release2026-11-192025-09-252024-09-26
Latest minor (2026-11-27)19.018.717.12
End of life2031-11-192030-11-142029-11-08
Headline featureREPACK / REPACK (CONCURRENTLY), WAIT for standby consistencyAsync I/O subsystem, uuidv7(), virtual generated columnsIncremental backups, COPY ... ON_ERROR, faster vacuum
Logical replicationCan start without restarting the server; sequences replicatedpg_createsubscriber workflows matureReplication from standbys
Maintenance impactDrops the need for pg_repack in most casesBetter sequential scan throughputLower vacuum memory overhead
Upgrade risk from previous majorMedium — forced standard_conforming_strings, RADIUS removedMedium — new default checks around authLow
Best fitNew clusters, heavy-update tables, read scalingClusters needing a proven modern baseConservative fleets with long extension chains

Decision matrix: pick your version in ten seconds

Your situationTargetWhy
New self-hosted app, no legacy extensions19.0Longest support window, REPACK removes a whole class of operational scripts
Read-heavy API with replicas19.0WAIT gives read-your-writes on standbys without application-side polling
Cluster with pg_repack in cron19.0Native REPACK (CONCURRENTLY) replaces the extension and its triggers
Fleet pinned by a vendor extension18.7One year of extra soak time before the 19 jump
Old hardware, 16 GB RAM, no test cluster17.12 until you have stagingDo not combine a major upgrade with a hardware change
Anything on 15 or earlierMigrate this quarterUnsupported, and the gap grows with every minor release

What PostgreSQL 19 actually changes

PostgreSQL project logo

The PostgreSQL 19 release notes list five changes that matter operationally. Everything else is planner and executor polish.

1. REPACK is now a first-class command. The new command reclaims disk space and reorganises table contents, and the concurrent variant keeps reads and writes flowing:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
-- Blocking rewrite: takes an ACCESS EXCLUSIVE lock, like VACUUM FULL
REPACK public.events;

-- Online rewrite: copies into a shadow copy while the table stays writable
REPACK (CONCURRENTLY) public.events;

-- Check progress from a second session
SELECT pid, state, wait_event_type, wait_event, query
FROM pg_stat_activity
WHERE query ILIKE 'REPACK%';

For a 400 GB table with a steady write load, VACUUM FULL is a maintenance window and REPACK (CONCURRENTLY) is a background job. That single change is why many teams will move to 19 within the first quarter — see our table maintenance comparison for how the extension-based workflow looked before.

2. WAIT gives read-your-writes on standbys. Instead of polling pg_last_wal_replay_lsn() in application code, a read replica can now block until it has replayed up to a given LSN:

1
2
3
4
5
-- On the primary: capture the LSN after a write
SELECT pg_current_wal_insert_lsn();

-- On the standby: block until that LSN is replayed
WAIT FOR LSN '0/1A2B3C4D';

Applications that previously shipped sticky-session hacks for “read your own write” can delete that code.

3. Logical replication without a restart. If wal_level is already replica, logical replication can be enabled without bouncing the server. Sequence values are replicated too, which removes the classic “subscriber sequence is behind after failover” duplicate-key incident.

4. pg_plan_advice and pg_stash_advice. Two extensions let you pin planner decisions and apply stored advice automatically for matching queries — a middle ground between pg_hint_plan and full plan freezing.

5. Automatic I/O worker scaling and parallel autovacuum of indexes. The number of I/O workers now scales with load, foreign-key checks are quicker, and autovacuum can process table indexes in parallel with a new scoring system deciding which tables go first.

Upgrade paths, compared honestly

MethodDowntimeDisk headroomHandles extension changesBest for
pg_upgrade --linkMinutesLow (hard links)No — binaries must matchSame-host, same-architecture jumps with a tested extension set
pg_upgrade (copy mode)Minutes to hoursFull copy of the clusterNoHosts with spare disk and a hard rollback requirement
Logical replicationNear zeroFull copy + WAL retentionYes — schema can be reshapedCross-version, cross-host, zero-downtime cutovers
pg_dumpall / restoreHoursFull copyYesSmall clusters, or when the data directory is corrupt anyway

The mechanics for a linked upgrade on Debian or Ubuntu look like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Install both majors side by side
sudo apt install postgresql-19 postgresql-19-pgvector

# Stop both clusters before running pg_upgrade
sudo systemctl stop postgresql@18-main

sudo -u postgres /usr/lib/postgresql/19/bin/pg_upgrade \
  --old-datadir=/var/lib/postgresql/18/main \
  --new-datadir=/var/lib/postgresql/19/main \
  --old-bindir=/usr/lib/postgresql/18/bin \
  --new-bindir=/usr/lib/postgresql/19/bin \
  --link \
  --check

# Only after --check passes cleanly, run without --check

If --check reports missing shared libraries for an extension, stop. Either rebuild the extension against 19 or switch to logical replication, where the subscriber is a genuinely new cluster.

For zero-downtime cutovers, the shape is a publication on the old cluster and a subscription on the new one:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
-- Old cluster (18.x)
CREATE PUBLICATION pg19_migration FOR ALL TABLES;

-- New cluster (19.0)
CREATE SUBSCRIPTION pg19_migration
  CONNECTION 'host=old-db port=5432 dbname=app user=repl password=...'
  PUBLICATION pg19_migration;

-- Watch lag until it reaches zero, then flip the connection string
SELECT subname, received_lsn, latest_end_lsn FROM pg_stat_subscription;

Our logical replication deep dive covers the publication/subscription variants if you need per-table filtering.

PostgreSQL 18 and 17: when staying back is the right call

PostgreSQL 18 is not a stepping stone you skip lightly. It introduced the asynchronous I/O subsystem that lifts sequential scan throughput, uuidv7() for time-ordered UUIDs without a extension, virtual generated columns, and OAuth 2.0 authentication. If your application generates identifiers in the database, uuidv7() alone justifies 18 over 16.

PostgreSQL 17 remains the conservative choice: incremental backups with pg_basebackup --incremental, COPY ... ON_ERROR ignore for messy imports, and a vacuum implementation that uses far less memory on large tables. A 17.12 cluster is supported until November 2029 — long enough to plan a deliberate jump rather than a panicked one.

The rule I use: upgrade the major when you need a feature or when the EOL date is less than 24 months away, whichever comes first. In November 2026 that means new clusters go to 19, 17 clusters can wait one more cycle, and 16 clusters should already have a staging 19 instance running.

Pitfalls that only show up during the upgrade

standard_conforming_strings can no longer be turned off. PostgreSQL 19 forces it on at the server level. Dumps made by pre-19 pg_dump binaries with standard_conforming_strings = off will not load cleanly. Take the dump with the 19 client, not the old one.

RADIUS authentication is gone. If pg_hba.conf has a radius line, the server will not start after the upgrade. Move those users to SCRAM or LDAP first.

inet and cidr default opclasses changed from btree_gist to GiST. Indexes on those types are rebuilt during pg_upgrade; if you rely on exclusion constraints over IP ranges, verify the constraint still exists afterwards.

MD5 passwords now produce warnings after successful authentication, and md5_password_warnings can silence them. The right answer is to rotate to SCRAM, not to silence the warning.

Carriage returns and line feeds are rejected in database, role, and tablespace names. pg_upgrade refuses to start on a cluster that contains such names. Audit before you schedule the window:

1
2
SELECT datname FROM pg_database WHERE datname ~ '[\r\n]';
SELECT rolname FROM pg_roles WHERE rolname ~ '[\r\n]';

REPACK is not free. It rewrites the table, needs free space equal to the table plus its indexes, and generates a large amount of WAL. Schedule it off-peak and watch replica lag.

Post-upgrade checklist

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
-- 1. Confirm the version and that all databases came across
SELECT version();
SELECT datname, datallowconn FROM pg_database ORDER BY 1;

-- 2. Rebuild planner statistics (pg_upgrade does not carry them)
VACUUM (ANALYZE, VERBOSE) app_db;

-- 3. Check for invalid indexes left behind by a failed concurrent build
SELECT indexrelid::regclass, indrelid::regclass
FROM pg_index WHERE NOT indisvalid;

-- 4. Verify replication slots and subscriptions survived
SELECT slot_name, active, restart_lsn FROM pg_replication_slots;

Then run the read-only smoke tests your application already has, and only afterwards re-enable write traffic. If you used --link, keep the old PG_VERSION directory until the first successful backup on 19 completes — the hard links mean the old cluster is no longer independent.

FAQ

Is PostgreSQL 19 stable enough for production in November 2026? Yes. PostgreSQL major releases are considered production-ready at .0, and 19.0 shipped on November 19, 2026 after the usual beta cycle. The pragmatic pattern is to run 19.0 on staging immediately and move production after the first minor (19.1), which typically lands within three months.

How long is PostgreSQL 19 supported? Until November 19, 2031 — five years of support, matching the project’s standard policy. PostgreSQL 18 runs to November 2030 and 17 to November 2029.

Can I skip PostgreSQL 18 and go straight from 17 to 19? Yes. Major-version upgrades are always from your current version to the target, not sequential. pg_upgrade from 17 to 19 works directly, as does logical replication.

Does REPACK replace pg_repack entirely? For most table bloat cases, yes. REPACK (CONCURRENTLY) covers the online rewrite that pg_repack was installed for. Clusters that use pg_repack for index-only reorganisations should verify behaviour before removing the extension.

How much downtime should I budget? For a 200 GB cluster on the same host, pg_upgrade --link typically finishes in 3-8 minutes plus statistics rebuild. Logical replication has no planned downtime but needs days of soak time for the initial copy on large datasets.


💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com