Skip to content
Stacklumen is now a solutions companySee the list here

PostgreSQL 19 is out: tidy busy tables without locking them

PostgreSQL 19 adds REPACK (CONCURRENTLY) to clear table bloat without blocking reads or writes, a one-statement "get or create", and new defaults to check before you upgrade. It is supported until November 2031.

Stacklumen blog card reading 'PostgreSQL 19 is out', with a query window running REPACK (CONCURRENTLY) on a sessions table while reads and writes are not blocked, an INSERT ... ON CONFLICT DO SELECT query, and a support line from 19 November 2026 to 19 November 2031.
On this page
  1. Cleaning up busy tables without downtime
  2. Steadier query plans
  3. Changes developers will notice
  4. Replication and monitoring
  5. Defaults and removals to check before you upgrade
  6. What it means for your site
  7. Sources

PostgreSQL 19 was released on 19 November 2026. If a site or app you run keeps its content, orders or accounts in PostgreSQL, this release is worth a look. It brings a way to clean up busy tables without locking them, a simpler "get or create" query, and several defaults that change on upgrade. It is supported until 19 November 2031.

Cleaning up busy tables without downtime

Tables that see many updates and deletes collect unused space, known as bloat, which can slow queries down. Until now the fix was VACUUM FULL or CLUSTER, and both blocked access to the table until they finished.

PostgreSQL 19 adds the REPACK command. It reclaims that space and can reorder a table to match an index. Run as REPACK (CONCURRENTLY), it does this without blocking reads or writes. VACUUM FULL and CLUSTER stay available for compatibility.

Autovacuum, the background process that keeps tables tidy, can now vacuum indexes with parallel workers, set by the new autovacuum_max_parallel_workers setting. It also uses a new scoring system to decide which tables to process first, and the new pg_stat_autovacuum_scores view shows that order.

Steadier query plans

The query planner can switch to a slower plan as data changes. The new pg_plan_advice extension lets you fix plan choices in place and try other plans. Its companion, pg_stash_advice, stores that advice and applies it to matching queries automatically, so a slow plan can be fixed without changing application code.

Changes developers will notice

  • INSERT ... ON CONFLICT DO SELECT lets RETURNING hand back the existing row when an insert conflicts. That covers the common "get or create" pattern in one statement.
  • COPY can now output JSON, including as a single JSON array.
  • The SQL/JSON path language gains string methods such as lower(), upper(), replace(), split_part() and btrim().
  • The lead(), lag(), first_value(), last_value() and nth_value() window functions can skip NULLs with IGNORE NULLS.
  • random() can now generate dates and timestamps within a range.
  • For apps that read from standby servers, the new WAIT FOR LSN command lets a session wait until the standby has caught up, so it can read data it just wrote on the primary.

The project also says many workloads get faster without code changes. Foreign key checks are quicker, which in the project's testing made bulk inserts nearly twice as fast. The planner can turn some NOT IN clauses into more efficient joins and aggregate rows before a join.

Replication and monitoring

Creating the first logical replication slot now raises the effective WAL level to logical automatically, so enabling logical replication no longer needs a server restart. Sequence values can now be replicated too, and CREATE PUBLICATION gains an EXCEPT clause to leave tables out. New views include pg_stat_lock and pg_stat_recovery, and EXPLAIN ANALYZE gains an IO option.

Defaults and removals to check before you upgrade

  • JIT is off by default. The project found the cost estimates used to decide when to use it were unreliable. If you run many large analytical queries, you may want to turn it back on.
  • md5 passwords now warn. A successful md5 password login now issues a warning, which the md5_password_warnings setting can turn off. md5 was deprecated in PostgreSQL 18 and will be removed in a future release. The project recommends SCRAM authentication instead.
  • RADIUS authentication is removed.
  • I/O worker settings change. io_min_workers and io_max_workers replace io_workers, and PostgreSQL now adjusts the number of workers between them.
  • TOAST compression defaults to lz4 when PostgreSQL is built with LZ4 support.

The server can also now present a different TLS certificate per hostname (SNI), mapped in a new pg_hosts.conf file.

What it means for your site

  • Check your version. PostgreSQL 14 reached end of life on 12 November 2026, and 15 is supported until 11 November 2027. If a site you run is on 14 or earlier, upgrade now; if it is on 15, plan the move. Version 19 is supported the longest.
  • Test before you move. Upgrade a copy of the database first and run your app against it. Look in particular at login settings that still use md5, any RADIUS setup, and any config that sets io_workers.
  • Watch heavy reports. If you rely on long analytical queries, compare their timings with JIT off and on.
  • Use REPACK (CONCURRENTLY) for bloat. Tables that hold sessions, carts or logs churn quickly and are good candidates, now without a maintenance window.
  • If you use a managed database, check your provider's own notes for when version 19 is offered.

Sources

New posts by email

Product updates and field notes from Stacklumen, in one email a day or one a week.

How often