PostgreSQL 19 今日达到一般可用性(GA)状态,并于同日在 Databricks Lakebase 和 Neon 平台上提供访问 1。该版本重点解决运维痛点,引入了多项关键功能以优化性能和管理体验 1。
在核心特性方面,PostgreSQL 19 新增了 REPACK 命令,可在大多数操作期间允许正常读写(使用 CONCURRENTLY),但在最后阶段需要 ACCESS EXCLUSIVE lock;若并发更新/删除超过约 1.04 亿个元组则会失败 1。查询优化器迎来了 pg_plan_advice 和 pg_stash_advice 两项新功能,用于干预优化器生成的执行计划,而非添加跨表统计信息 1。此外,Autovacuum 现支持并行工作进程(由 autovacuum_max_parallel_workers 控制),并增加了 pg_stat_lock、pg_stat_recovery 和 pg_stat_autovacuum_scores 等新的统计视图 1。
逻辑复制与数据同步机制也得到了改进。当 wal_level 设为 replica 时,创建槽位会提升 effective_wal_level;系统支持 FOR ALL TABLES EXCEPT (...) 语法;新增 retain_dead_tuples 选项以检测 update_deleted 冲突;序列值在订阅创建时可同步 1。为了解决读己之写问题,新版本引入了 WAIT FOR LSN 命令,阻塞备库直到重放达到指定位置 1。其他增强功能包括 postgres_fdw 支持从远程服务器导入统计信息 (ANALYZE)、INSERT ... ON CONFLICT DO SELECT 提供 get-or-create 模式,以及 COPY TO 支持直接输出 JSON 1。
部分原计划的功能未包含在 PostgreSQL 19 中并被移除,包括 SQL/PGQ 属性图查询、UPDATE/DELETE ... FOR PORTION OF、ALTER TABLE ... MERGE/SPLIT PARTITION、GROUP BY ALL 以及 pg_dumpall 1。预计 PostgreSQL 19.1 将在明年二月发布 1。
PostgreSQL 19 has reached General Availability status today and is instantly accessible on both Databricks Lakebase and the Neon platform 1. This release focuses heavily on resolving operational pain points, introducing significant changes to maintenance workflows, query planning, and replication mechanisms 1. The new version includes a REPACK command designed to reclaim space concurrently during most operations; however, it requires an ACCESS EXCLUSIVE lock in its final phase and will fail if concurrent updates or deletes exceed approximately 104 million tuples 1. Additionally, autovacuum now supports parallel worker processes, which are controlled by the autovacuum_max_parallel_workers setting 1.
The update introduces new tools for optimizing query execution, specifically pg_plan_advice and pg_stash_advice, which allow users to intervene in the optimizer's generated execution plans rather than relying solely on cross-table statistics 1. New statistical views have also been added, including pg_stat_lock, pg_stat_recovery, and pg_stat_autovacuum_scores 1. In terms of data access and movement, logical replication has seen improvements such as automatic elevation of effective_wal_level when creating slots with wal_level set to replica, support for excluding specific tables via FOR ALL TABLES EXCEPT (...), and a new retain_dead_tuples option to detect update_deleted conflicts 1. Sequence values can now be synchronized at the time of subscription creation, and the new WAIT FOR LSN command allows standby servers to block until replay reaches a specified position, addressing read-your-writes consistency issues 1. Furthermore, postgres_fdw now supports importing statistics from remote servers during ANALYZE operations, while INSERT ... ON CONFLICT DO SELECT provides a get-or-create pattern, and COPY TO supports direct JSON output 1.
Several features originally planned for this cycle were removed from the PostgreSQL 19 release. These include SQL/PGQ property graph queries (revoked on September 7, 2026), UPDATE/DELETE ... FOR PORTION OF (revoked on September 15, 2026), ALTER TABLE ... MERGE/SPLIT PARTITION (revoked on August 27, 2026), GROUP BY ALL (revoked on July 17, 2026), and pg_dumpall (revoked on June 18, 2026) 1. Looking ahead, PostgreSQL 19.1 is expected to be released in February of next year 1.
评论
还没有评论,欢迎留下第一条。