PostgreSQL 19 was released on November 19, 2026. The release notes are long, but only a few changes affect the day-to-day of someone maintaining a web system: a new command to reclaim disk space, a more useful INSERT, and a list of incompatibilities worth testing before you upgrade.
This text is for developers and for whoever decides when to upgrade the database. It does not cover everything; it covers what to check first.
REPACK: reclaim space without locking the table
Tables with many updates and deletes pile up dead space. Plain VACUUM reuses that space inside the table but, according to the documentation, in most cases does not return it to the operating system. That used to be the job of VACUUM FULL, which blocks the table completely.
Version 19 introduces REPACK, which rewrites the table into a new file. The documentation pages themselves say that CLUSTER is equivalent to REPACK ... USING INDEX and that the FULL option of VACUUM is deprecated and behaves like REPACK without an index. The old commands keep working.
The practical novelty is the CONCURRENTLY option:
-- rewrites the table and reorders rows according to the given index
REPACK (CONCURRENTLY, VERBOSE) pedidos USING INDEX pedidos_criado_em_idx;
-- follow progress
SELECT * FROM pg_stat_progress_repack;
With it, most of the work runs under a SHARE UPDATE EXCLUSIVE lock, and ACCESS EXCLUSIVE is only requested in the final phase, when the files are swapped. Reads and writes continue during the process.
It is not free. The documentation lists restrictions you need to know:
- the table must have a primary key or an index-based replica identity;
- it does not work on
UNLOGGEDor partitioned tables, or inside a transaction block; - you need free space of at least the table size plus its indexes, because it builds a copy;
- the page warns that
CONCURRENTLYis "not MVCC-safe": after the commit, the table can look empty to transactions using a snapshot taken before theREPACKstarted; - concurrent DDL on the same table can make the operation fail;
- the command requires the
MAINTAINprivilege on the table.
In practice, treat it as a planned maintenance tool, tested first on a copy, not as a button to press in the middle of the workday. Without USING INDEX, it only reclaims space and does not reorder rows.
An upsert that returns the existing row
The "create if missing, otherwise return what exists" pattern often becomes an INSERT ... ON CONFLICT DO UPDATE with a pointless SET just to enable RETURNING. Version 19 accepts DO SELECT, which the documentation describes as "get or create":
INSERT INTO distributors (did, dname)
VALUES (11, 'Global Electronics')
ON CONFLICT (did) DO SELECT
RETURNING *;
Details the documentation requires: the conflict_target is mandatory, and so is the RETURNING clause. You can add FOR UPDATE or FOR SHARE to lock the existing row, and WHERE to filter when it should be returned. If the WHERE condition is not met, the row does not appear in the result.
For creating users, invite tokens, or idempotency records, this removes an unnecessary write and makes the intent explicit in the SQL.
What can break during the upgrade
The migration section of the notes opens with a direct warning: to move from any earlier version you need pg_dumpall with a restore, pg_upgrade, or logical replication. There is no swapping the binary and restarting. For anyone hiring, that means planning a maintenance window, a tested backup, and a rehearsal in a staging environment.
Items from the notes most likely to affect a typical application:
| Change | Practical effect |
|---|---|
| JIT off by default | Heavy analytical queries may require turning jit = on manually |
max_locks_per_transaction goes from 64 to 128 |
If you had a custom value, double it to keep the same capacity |
standard_conforming_strings always on |
Old dumps made with off do not load correctly |
json_array() with no rows |
Returns an empty array instead of NULL |
Full text search and pg_trgm |
Use the database's locale provider; the notes recommend reindexing and recomputing stored tsvector values |
btree_gist indexes on inet/cidr |
pg_upgrade refuses the cluster; the default opclass is now GiST |
| MD5 authentication | Logs a warning after a successful login (disable with md5_password_warnings); RADIUS was removed |
MULE_INTERNAL encoding |
Removed; the database must be dumped and restored in another encoding |
Two other points in the notes matter for operations: the io_workers parameter was replaced by io_min_workers and io_max_workers, and database, role, and tablespace names can no longer contain line breaks.
Logical replication without a restart
When wal_level is replica, you can now enable logical replication without restarting the server. According to the announcement, the effective level rises to logical when the first logical replication slot is created, and the effective_wal_level parameter shows the value in use. Since logical replication is one of the supported paths for migrating from an earlier version, this removes one restart from the preparation.
Checklist before upgrading
There is no rush to upgrade on release day. The reasonable decision is to test, measure, and only then schedule the window. A minimal plan:
- Read the full migration section of the release notes; this text summarizes only part of it.
- Restore a recent backup in a test environment and run
pg_upgrade --checkor a full rehearsal. - Check the values that change defaults on the current cluster:
SHOW standard_conforming_strings;
SHOW max_locks_per_transaction;
SHOW jit;
- Look for
btree_gistindexes oninet/cidrcolumns and databases using theMULE_INTERNALencoding. - Plan to reindex full text search and
pg_trgm. - Run the application test suite and the slowest queries against the new version, comparing plans.
- Only then pick the path (
pg_upgradeor logical replication) and define a rollback plan.
If the system uses a managed service, confirm with the provider when version 19 will be available and how they handle the upgrade.
Sources
Enjoyed the article? Share it
Get new articles by email
Practical guides and technical analysis, no spam. Unsubscribe anytime.
