PostgreSQL 19 Beta: Native Table Repacking, Partition Merging, and SQL Property Graph Queries
The upcoming PostgreSQL 19 release moves key operational capabilities into core, introducing native concurrent table repacking and parallelized autovacuum processes. The release also improves high-availability workflows with sequence synchronization in logical replication and adds native SQL/PGQ support.
Native Table Repacking and Dynamic Partitioning
PostgreSQL 19 integrates table reorganization directly into core with the new `REPACK CONCURRENTLY` command. Historically, reclaiming table bloat or rewriting storage layouts without executing blocking locks—such as those required by `VACUUM FULL` or `CLUSTER`—required third-party extensions like `pg_repack`. This native implementation allows administrators to run online table reorganizations natively, reducing external dependency overhead in high-throughput environments.
Partitioning mechanics also receive operational updates, allowing systems engineers to split and merge existing partitions inline. Rather than rebuilding partition trees manually when data distribution patterns or retention windows shift, administrators can adjust the schema dynamically. The syntax supports merging multiple partitions into a single destination, as well as splitting a broader range partition into smaller, discrete intervals.
Matured Logical Replication and Sequence Synchronization
Logical replication is increasingly used for active-passive migrations and zero-downtime upgrades. PostgreSQL 19 addresses a critical pain point by synchronizing sequence values between publishers and subscribers, mitigating the risk of ID collision post-cutover. This includes support for `ALL SEQUENCES` in publications, sequence synchronization error reporting, and refined subscription refresh behavior.
Schema replication definitions become more granular with the addition of the `EXCEPT` clause, which allows operators to exclude specific tables when defining wildcard publications. For configuration simplification, setting `wal_level = replica` can automatically enable logical replication as needed, while the new `effective_wal_level` system parameter provides immediate visibility into the actual active WAL level.
Parallel Autovacuum and Scheduling Diagnostics
To prevent table bloat and transaction ID wraparound on high-write systems, the autovacuum daemon can now execute with parallel vacuum workers. This concurrency is configurable both globally via `autovacuum_max_parallel_workers` and on a per-table basis.
The update introduces a prioritization scoring system to govern the order of autovacuum operations. Operators can adjust these heuristics using parameters like `autovacuum_vacuum_insert_score_weight` and `autovacuum_vacuum_score_weight` to match table-specific write patterns. Diagnostics are exposed through the new `pg_stat_autovacuum_scores` view, alongside enhanced telemetry in `VACUUM VERBOSE` output and a dedicated `log_autoanalyze_min_duration` setting.
SQL Property Graphs and COPY Enhancements
PostgreSQL 19 implements SQL/PGQ (SQL property graph queries) standards, allowing relational tables to be queried directly as graphs of vertices and edges without migrating data to dedicated graph databases. This relational-graph hybrid model avoids additional operational sync paths while providing graph-style traversals on standard tables.
Finally, the `COPY` utility receives throughput and ingestion improvements. The `COPY FROM` command can now skip multiple metadata header lines, and it introduces support for `ON_ERROR SET_NULL` to handle formatting anomalies during bulk loading operations.