PostgreSQL 19 shipped on 19 November 2026. Alongside the plan advice we covered in June, it brings a new REPACK command that replaces VACUUM FULL and CLUSTER, and a CONCURRENTLY option that rewrites a bloated table without blocking reads or writes. That is the job teams have handed to the pg_repack extension. We ran all three commands on the 19.0 image against the same bloated table under a steady write load. VACUUM FULL stalled a client for up to 864 ms. REPACK (CONCURRENTLY) never stalled one for more than 25 ms.

For a plain table with a primary key, that is enough to stop reaching for pg_repack first on Postgres 19. Three things decide whether it is enough for yours: a long-running REPEATABLE READ transaction can see the repacked table as empty, the command refuses tables set to REPLICA IDENTITY FULL, and two runs on the same server queued one behind the other in our tests.

What we measured on 19.0

The setup was deliberately small. A postgres:19 container (PostgreSQL 19.0 (Debian 19.0-2.pgdg13+1) on aarch64) with the default configuration, running in a podman VM with 8 vCPUs and 10 GiB on an Apple M3 Pro. The table had 2 million rows with a 200-byte payload, a primary key and one secondary index. Deleting every even id and updating every third row, followed by a plain VACUUM, left 544 MB on disk for 1 million live rows.

For each run we rebuilt that bloat from scratch, started pgbench with 4 clients doing a single-row UPDATE and SELECT by random id (about 13,000 transactions per second), and fired the maintenance command 5 seconds in. Each command ran twice.

CommandRun timeWorst client transactionTransactions over 100 msWAL written
VACUUM FULL orders1.00 s, 0.99 s864 ms, 837 ms4, 4270 MB
REPACK orders0.94 s, 0.96 s782 ms, 832 ms4, 4270 MB
REPACK (CONCURRENTLY) orders1.13 s, 1.20 s25 ms, 15 ms0, 0307 MB

Every run ended at the same 280 MB, so the concurrent rewrite reclaims as much space as the blocking one. Plain REPACK behaves like the VACUUM FULL it replaces, which matches the docs: without CONCURRENTLY, an ACCESS EXCLUSIVE lock "is acquired at the beginning and remains held throughout the operation". The concurrent version wrote about 14% more WAL and took about 0.2 s longer. It is the same trade Valkey 9.2 made with forkless snapshots: one large stall becomes a steady extra cost on writes while the job runs.

Treat these as numbers from one laptop: one table shape, and every run took about a second. Because the blocking version holds its lock for the whole rewrite, we would expect the gap to widen on larger tables, but we did not test one, and nothing here predicts how long yours will take. Alex Georgiev's test on 19 beta 4 points the same way: a client blocked for 4.35 to 5.31 s under VACUUM FULL across three trials, against 0.35 to 0.93 s for the concurrent run.

It replays WAL instead of firing triggers

pg_repack works by adding a trigger to your table that logs every INSERT, UPDATE and DELETE into a log table, copying the rows to a new table, replaying the log and then swapping the two "using the system catalogs", per its documentation. The trigger runs inside every write to your table for as long as the repack takes.

The core command copies the table under a SHARE UPDATE EXCLUSIVE lock, which does not conflict with reads or writes, and captures concurrent changes "using logical decoding", according to the REPACK reference page. It applies those changes, takes ACCESS EXCLUSIVE only for the final file swap, and replays whatever arrived while it waited for that lock. The design comes from pg_squeeze, which already used "logical decoding instead of triggers to capture concurrent changes". The release notes credit REPACK to Antonin Houska, a pg_squeeze contributor, and the concurrent mode to Houska, Mihail Nikalayeu and Alvaro Herrera.

You can watch the machinery while it runs. Polling pg_replication_slots mid-run showed a logical slot named pg_repack_91 with the pgrepack output plugin, and pg_stat_progress_repack reported seq scanning heap 58077/62500. The slot disappeared when the command finished.

No wal_level change and no restart

That slot is why you do not have to change wal_level. pg_squeeze asks you to set wal_level = logical in its install steps. Postgres 19 adds effective_wal_level, which shows logical whenever a logical slot exists even though wal_level is still replica. On our server it went from replica to logical when the repack started, stayed logical after the slot was gone, and dropped back to replica after the next CHECKPOINT. The concurrent runs also wrote 37 MB more WAL than the blocking ones, and your replicas and WAL archive receive that too.

Write down two numbers from the reference page before you run it on something large. The command needs free disk "at least equal to the sum of the table size and the index sizes", since it builds a full copy. And "if more than about 104 million rows are concurrently updated or deleted" during the run, it fails.

Two paths for capturing live changes: a trigger hook on each write versus a reader tailing the write-ahead log

A transaction that started earlier can see an empty table

The REPACK page warns: "REPACK with the CONCURRENTLY option is not MVCC-safe. After the repacking transaction commits, the table will appear empty to concurrent transactions, if they are using a snapshot taken before repacking started." A commenter in the Hacker News thread about the release asked "Isn't losing MVCC consistency a pretty big drawback?", so we reproduced it.

Session A opened a REPEATABLE READ transaction and read a different table, which fixes its snapshot. Session B ran REPACK (CONCURRENTLY) orders. Then session A counted orders:

-- session A
BEGIN ISOLATION LEVEL REPEATABLE READ;
SELECT count(*) FROM events2;   -- snapshot taken here
-- session B runs: REPACK (CONCURRENTLY) orders;
SELECT count(*) FROM orders;    -- 0
COMMIT;
SELECT count(*) FROM orders;    -- 1000000

Zero rows, with no error. The same test under READ COMMITTED returned 1,000,000, because each statement takes a fresh snapshot. Plain REPACK orders without CONCURRENTLY also returned 1,000,000 to the old REPEATABLE READ snapshot.

The exposure is narrower than the warning sounds. The MVCC caveats page says it only hits a transaction "that did not access the table in question before the command started", because one that did holds an ACCESS SHARE lock until it ends, and that lock blocks the final swap. The same page lists TRUNCATE and table-rewriting ALTER TABLE as unsafe in the same way. It is not a regression from the extensions either: the pg_squeeze README says that "Like pg_repack, pg_squeeze also changes visibility of rows and thus allows for MVCC-unsafe behavior".

So the people who should care are the ones running long REPEATABLE READ or SERIALIZABLE transactions that read several tables in sequence: reporting jobs, consistency checks, exports that compare tables. If one of those starts before your repack and reaches the repacked table after it, it reads nothing and reports nothing wrong. Schedule the repack outside those windows, or check pg_stat_activity for old xact_start values first. While it runs, the reference page suggests watching pg_stat_activity.backend_xid for the repack itself.

The tables it refuses

The docs list the cases where CONCURRENTLY cannot be used. We hit each one on 19.0 to get the exact errors, since those are what you will search for later:

TableWhat 19.0 saysWay out
No primary keyRelation "events_nopk" has no identity index.Add a primary key, or a replica identity index
Unique index on a NOT NULL column, no primary keyRelation "events2" has no identity index.ALTER TABLE ... REPLICA IDENTITY USING INDEX (worked)
REPLICA IDENTITY FULL (with a primary key)This operation does not support tables with REPLICA IDENTITY FULL.Blocking REPACK, or pg_repack
Partitioned parentREPACK (CONCURRENTLY) is not supported for partitioned tablesRepack each leaf partition; that worked
UNLOGGEDThis operation is only supported for permanent relations.Blocking REPACK (worked)
Materialized viewThis operation is not supported for materialized views.Blocking REPACK (worked)
Inside BEGIN ... COMMITREPACK (CONCURRENTLY) cannot run inside a transaction blockRun it in autocommit
No table nameREPACK (CONCURRENTLY) requires an explicit table nameLoop over tables yourself

If you are coming from pg_repack, watch the no-primary-key and unique-index rows. It accepts a table with "a PRIMARY KEY, or at least a UNIQUE total index on a NOT NULL column". Core REPACK wants a replica identity, which is the primary key by default. A unique index alone failed until we pointed the replica identity at it:

ALTER TABLE events2 REPLICA IDENTITY USING INDEX events2_uq;
REPACK (CONCURRENTLY) events2;   -- REPACK

According to the ALTER TABLE docs, this setting "has no effect except when logical replication is in use", so it is safe on a table that does not publish anywhere. On one that does, such as a table feeding one of the sync engines built on Postgres logical replication, it changes what your subscribers receive for updates and deletes.

Then there is REPLICA IDENTITY FULL. It "Records the old values of all columns in the row", which is the setting you reach for when a logical replication or change-data-capture consumer needs the whole old row. The docs' list of refused cases does not mention it, but 19.0 refused it even on a table with a primary key. If your largest, most-updated tables are the ones feeding a CDC pipeline, they are exactly the ones REPACK (CONCURRENTLY) will not touch. That leaves pg_repack or a blocking REPACK. On our test table, switching to REPLICA IDENTITY DEFAULT, repacking concurrently and switching back to FULL also worked, but your consumer gets primary-key-only old rows for the changes made in between, so agree on that with whoever owns it first.

Replication slots: two runs queued, a cancel cleaned up

Two repacks at once ran one after the other

Postgres 19 adds a max_repack_replication_slots setting that defaults to 5 and "can only be set at server start", which reads like five repacks can run side by side. Christophe Pettus, writing about the pre-release code in May, said the opposite: "only one such operation can run at a time across the whole instance."

On 19.0 both turned out to be partly right. We started REPACK (CONCURRENTLY) on two different 1-million-row tables in the same second. Both slots appeared (pg_repack_419 and pg_repack_421), but the second command sat in phase initializing with wait event IPC/RepackWorkerExport until the first finished. The first took 1.3 s and the second 2.5 s. We ran it twice and got the same ordering both times.

pg_repack has a --jobs flag, but its docs describe it as parallelizing "the rebuild of indexes on each table", not running tables side by side. Plan a maintenance window as a sequence of tables, not a batch, and expect the queue to be the sum of the individual runs.

Cancelling a run left no orphan slot

Pettus also warned that a failed run can leave an orphaned slot that holds WAL. So we cancelled one mid-scan with pg_cancel_backend. The client got canceling statement due to user request and pg_replication_slots was empty. We did not test a crashed backend or a killed server, so keep watching for leftover pg_repack_* slots after anything unusual.

DDL waits behind it, and reads wait behind the DDL

The docs warn that REPACK (CONCURRENTLY) "might fail to complete if DDL commands are executed on the table". What we saw first was the other direction. We started a repack, sent ALTER TABLE orders2 ADD COLUMN note text 0.3 s later, and a single-row SELECT 0.2 s after that.

Our repack finished normally in 1.1 s. The ALTER waited 842 ms for the repack's SHARE UPDATE EXCLUSIVE lock, and the SELECT, which needs only ACCESS SHARE, waited 640 ms because it queued behind the ALTER's pending ACCESS EXCLUSIVE request. Scale that to a repack that runs for an hour, and every query on the table queues for as long as the migration waits.

Use the fix you should already use for migrations: a lock timeout on the DDL, so it gives up instead of queueing.

SET lock_timeout = '100ms';
ALTER TABLE orders2 DROP COLUMN note;
-- ERROR:  canceling statement due to lock timeout

With that set, the ALTER failed fast and the repack completed. If your deploy pipeline runs migrations automatically, pause it during a repack or make sure it sets lock_timeout. Long repacks have one more cost: the reference page says the command counts as "a single long-running transaction, which prevents VACUUM from cleaning up dead rows from other tables", so a long repack of one table lets bloat build up in the others.

Should you uninstall pg_repack?

On Postgres 19, for ordinary heap tables with a primary key, yes: use the built-in command. It needs no extension and no client binary, only the MAINTAIN privilege on the table. Keep pg_repack around for the jobs core does not do:

NeedREPACK (CONCURRENTLY)pg_repack
Plain table with a primary keyYes, built inYes
Unique NOT NULL index, no primary keyAfter REPLICA IDENTITY USING INDEXYes
REPLICA IDENTITY FULL tableRefused on 19.0Needs a primary key or unique NOT NULL index (not tested here)
Rebuild only the indexesNo--only-indexes
Move a table to another tablespace onlineNo--tablespace
Order rows by arbitrary columnsOnly by an index (USING INDEX), and rows inserted during a concurrent run stay unordered--order-by
Postgres 18 and earlierNot availableYes

One catch if you plan to keep both on a Postgres 19 server: the newest tagged pg_repack release is 1.5.3 from October 2025, and its documentation lists supported versions only up to 18. A "Support for postgresql 19" pull request was merged on 1 May 2026 and the master branch docs list 19, but no release carries it yet. Until one does, your package manager decides whether you can install it on 19 at all.

REPACK does not exist before 19, so servers still on Postgres 18 or earlier keep pg_repack as their online option. For tables that need the space back and cannot use CONCURRENTLY, the blocking REPACK is the same tool as before under a better name, and VACUUM FULL and CLUSTER still work. Do not use either form to get out of transaction ID wraparound trouble. The reference page says plainly that it "can fail after most of the work is done, especially with CONCURRENTLY on a busy table" and recommends VACUUM for that job.

Before your first production run

This is the checklist we would use, built from the tests above and the reference page:

  • Check the table qualifies: a primary key or REPLICA IDENTITY USING INDEX, not FULL, not partitioned (repack the leaves instead), not unlogged, and no invalid index.
  • Free disk at least equal to the table plus its indexes, and room for extra WAL on the primary, replicas and archive.
  • No long REPEATABLE READ or SERIALIZABLE transactions running, and none scheduled during the window.
  • Migrations paused, or running with lock_timeout set.
  • Watch pg_stat_progress_repack while it runs and pg_replication_slots after it ends.

What to watch next: first, a tagged pg_repack release with Postgres 19 support, which decides whether you can keep it as a fallback. Second, whether a 19.x minor release documents the REPLICA IDENTITY FULL refusal or lifts it, since the reference page does not list it today.