PostgreSQL 19 introduces significant improvements in database maintenance, replication, query optimization, and performance. This blog explores six important enhancements, including the new REPACK command, restart-free logical replication enablement, sequence synchronization, WAIT FOR LSN, query plan management, and parallel autovacuum.
Jethish November 20, 2026
PostgreSQL continues to evolve with every major release, introducing improvements that make database administration more efficient, queries faster, and enterprise workloads more reliable. With the release of PostgreSQL 19 on November 19, 2026, the PostgreSQL Global Development Group has introduced several important enhancements focused on database maintenance, replication, query optimization, and performance.
This release addresses several challenges commonly faced by database administrators, including table bloat, query plan instability, logical replication configuration, sequence synchronization, and replication lag in primary-standby architectures.
Let’s explore six powerful enhancements introduced in PostgreSQL 19 and understand how they can benefit database administrators and developers.
Table bloat is a common challenge in PostgreSQL environments, particularly for tables that experience frequent UPDATE and DELETE operations.
Traditionally, PostgreSQL DBAs have relied on VACUUM FULL and CLUSTER to reclaim disk space and reorganize table contents. However, these operations have different purposes and can require strong locks that prevent normal access to the affected table during maintenance.
PostgreSQL 19 introduces the new REPACK command, bringing these table-reorganization capabilities under a unified command. The existing VACUUM FULL and CLUSTER commands remain available for backward compatibility.
The most significant addition is REPACK (CONCURRENTLY). It allows PostgreSQL to rebuild a table without acquiring an access-exclusive lock for the entire operation. This means normal reads and writes can continue while the table is being repacked.
Example:
-- Rebuild a table without blocking normal reads and writes
blogs=# REPACK (CONCURRENTLY) orders;
DBAs can monitor the operation from another session using the newly introduced pg_stat_progress_repack view.
-- Monitor table repacking progress
blogs=# SELECT * FROM pg_stat_progress_repack;
PostgreSQL 19 also introduces the max_repack_replication_slots configuration parameter to control the replication slots required for concurrent repacking.
For a detailed explanation of how REPACK works and how to test it, read our dedicated guide: REPACK in PostgreSQL 19: Finally, Online Table Bloat Removal.
Logical replication is widely used in PostgreSQL environments for database migrations, Change Data Capture (CDC), data synchronization, and reporting workloads.
Previously, enabling logical replication required configuring:
wal_level = logical
Since wal_level is a startup parameter, changing it required a PostgreSQL server restart. This could become challenging in production environments where database availability is critical.
PostgreSQL 19 simplifies this process. When wal_level is configured as replica, PostgreSQL can automatically enable logical replication when it is required, without requiring a server restart.
To understand the WAL level currently in effect, PostgreSQL 19 introduces the new read-only parameter:
blogs=# SHOW effective_wal_level;
This provides visibility into the effective WAL level being used by the server.
This enhancement is particularly useful for organizations running logical replication and CDC platforms, where minimizing database restarts is important.
Read our detailed article to understand how this feature works: PostgreSQL 19: A Smarter Way to Enable Logical Decoding with effective_wal_level.
Logical replication has traditionally replicated table changes, but sequence values were not automatically synchronized between publishers and subscribers. This created challenges during database migrations and application cutovers, especially when applications depended on sequences to generate unique identifiers.
PostgreSQL 19 addresses this limitation by introducing logical replication support for sequence values. DBAs can now publish all sequences using:
blogs=# CREATE PUBLICATION pub_all_seq FOR ALL SEQUENCES;
On the subscriber, sequence synchronization can be performed using:
blogs=# ALTER SUBSCRIPTION sub_main REFRESH SEQUENCES;
This helps synchronize sequence values between the publisher and subscriber, reducing the manual effort involved in preparing a replicated database for cutover.
PostgreSQL 19 also introduces several improvements to publication and subscription management.
These improvements make PostgreSQL logical replication more suitable for migration and CDC use cases where sequence consistency is important.
Need expert guidance on PostgreSQL 19? Connect with Mafiree’s PostgreSQL experts today!
Talk to Our PostgreSQL ExpertsIn PostgreSQL streaming replication environments, read queries are often routed to standby servers to distribute workloads and reduce pressure on the primary server. However, asynchronous replication introduces a familiar challenge: replication lag.
When an application performs a write on the primary and immediately reads the same record from a standby, the latest transaction may not yet have been replayed. This can result in stale data being returned to the application.
PostgreSQL 19 introduces the new WAIT command to address this challenge. Using WAIT FOR LSN, a session connected to a standby server can wait until the standby has reached a specified WAL position before executing subsequent queries.
Example:
blogs=# WAIT FOR LSN '0/0306EE20';
By default, this command waits until the specified LSN has been replayed on the standby server. Once the target LSN is reached, the application can execute its read query with the assurance that the corresponding WAL changes have been replayed.
PostgreSQL 19 also supports different waiting modes:
A timeout can also be specified to prevent an application from waiting indefinitely.
Example with timeout:
blogs=# WAIT FOR LSN '0/0306EE20'
blogs-# WITH (
blogs(# MODE 'standby_replay',
blogs(# TIMEOUT '5s',
blogs(# NO_THROW
blogs(# );
For applications using HAProxy, PgBouncer, or application-level read/write routing, this is an important enhancement.
Important consideration: the application must capture the relevant LSN from the primary after the write transaction commits and pass it to the standby session. The WAIT command must also execute before the session takes locks or acquires a snapshot that could interfere with WAL replay.
Query plan instability is a familiar challenge for PostgreSQL DBAs. A query that performs efficiently today may become slower tomorrow because of changes in data distribution, statistics, or query planner decisions.
Traditionally, DBAs have used techniques such as query rewriting, indexing, statistics adjustments, and configuration tuning to address these issues.
PostgreSQL 19 introduces the pg_plan_advice extension, which provides better control over query planner decisions. It allows DBAs to provide plan advice and experiment with alternative execution plans using a dedicated plan-advice language. This helps stabilize query plans without necessarily modifying the application’s SQL statements.
PostgreSQL 19 also introduces the companion pg_stash_advice extension. It stores plan advice and automatically applies it to queries based on their query identifiers. This is particularly useful when a critical application query starts choosing a less efficient execution plan after changes in data volume or distribution.
For DBAs managing high-volume transactional systems, this feature provides another approach to maintaining predictable query performance.
Autovacuum is one of the most important background processes in PostgreSQL. It is responsible for reclaiming dead tuples, updating statistics, maintaining visibility information, and preventing transaction ID wraparound.
However, in databases containing large tables and multiple indexes, vacuum operations can take considerable time and consume significant system resources. PostgreSQL 19 introduces improvements to make autovacuum more efficient.
PostgreSQL 19 allows autovacuum to use parallel workers when processing table indexes. The maximum number of workers is controlled by the new server configuration parameter:
autovacuum_max_parallel_workers = 4
DBAs can also configure the number of parallel autovacuum workers for individual tables using the autovacuum_parallel_workers storage parameter.
blogs=# ALTER TABLE orders SET (autovacuum_parallel_workers = 4);
This allows large tables with multiple indexes to benefit from parallel index vacuuming, potentially reducing maintenance time.
Another important enhancement is the introduction of a scoring-based prioritization system. Previously, autovacuum primarily relied on thresholds and eligibility conditions to determine which tables required maintenance. PostgreSQL 19 introduces a scoring mechanism to determine the order in which eligible tables should be processed.
The scoring system considers factors such as:
DBAs can tune the scoring weights using new configuration parameters:
The new pg_stat_autovacuum_scores view provides visibility into the per-table autovacuum prioritization details.
-- Inspect autovacuum prioritization
blogs=# SELECT * FROM pg_stat_autovacuum_scores;
PostgreSQL 19 also introduces several monitoring and maintenance improvements:
For a deeper understanding of autovacuum behavior, thresholds, and configuration, read our guide: PostgreSQL Autovacuum Explained in Detail.
For assistance with PostgreSQL major version upgrades and migration planning, explore Mafiree’s PostgreSQL Migration and Upgrade Services.
PostgreSQL 19 introduces meaningful improvements across database maintenance, replication, query optimization, and performance management. Features such as REPACK (CONCURRENTLY), restart-free logical replication enablement, sequence synchronization, WAIT FOR LSN, and smarter autovacuum provide practical solutions to challenges faced by database administrators in production environments.
For DBAs, these enhancements offer better control over maintenance operations, replication consistency, and query execution. For developers, they introduce capabilities that simplify application development and data synchronization.
As PostgreSQL continues to evolve, understanding these changes will help organizations make informed decisions about database performance, scalability, reliability, and future upgrades.
At Mafiree, we continue to explore PostgreSQL innovations and help organizations build, manage, optimize, and scale reliable database environments.
Miru IT Park, Vallankumaranvillai,
Nagercoil, Tamilnadu - 629 002.
Unit 303, Vanguard Rise,
5th Main, Konena Agrahara,
Old Airport Road, Bangalore - 560 017.
Call: +91 6383016411
Email: sales@mafiree.com