AMAZINGINDEX.COM 日报快照
60.3
VOL. 2026.07
2026.07.01
← 返回 2026.07.01 日报
日报快照 · Daily Snapshot
NO. 014

PostgreSQL 19 内置在线重组表

#ARTICLE HackerNews 2026.07.01
推荐指数 75.0 NO. 014 · 2026.07.01
发布2026/06/30Score186Comments111

PostgreSQL 19 将 REPACK CONCURRENTLY 内置,解决大表在线重组的运维痛点,同时引入 SQL 属性图查询和逻辑复制增强。对运行 TB 级数据库的工程师,这意味着终于不用依赖 pg_repack 第三方工具,升级即可减少计划内停机窗口。

pg_repack 这个外部工具用了十多年,但一直有权限复杂、与特定版本绑定、故障排查困难的问题,很多 DBA 宁愿选择低峰期短停也不敢上生产。内置后 REPACK CONCURRENTLY 成为一等公民,权限模型和日志体系跟原生一致,运维团队可以写进标准 playbook。

SQL 属性图查询(SQL/PGQ)值得关注但别高估短期落地,图数据库厂商如 Neo4j、TigerGraph 的生态壁垒还在,Postgres 这波更像是防守性布局——防止用户因为需要简单图查询而拆出第二个数据库。真正该优先测的是 VACUUM 改进,这对所有有膨胀表问题的实例都是无痛收益,不需要改应用代码。

意见分歧 107 条评论

核心争论:文章是否由AI生成引发争论,技术内容本身获认可

mkurz

No word that PostgreSQL 19 introduces native application-time temporal data support based on the SQL:2011 standard? https://www.depesz.com/2026/04/02/waiting-for-postgresql-19-...

m_w_

Nor more than a mention of Query Hints, which had some interesting discussion under a similarly-titled submission. https://news.ycombinator.com/item?id=48413655

unfocso

Wow. Incredible how this was not mentioned in the OP. I had done it with tcn triggers and adding "_archive" shadown tables manually with tcn (https://www.postgresql.org/docs/current/tcn.html), but doing it natively is gonna be, as per most postgresql implementations, wonderf

替代方案: pg_repackTCN触发器+归档表Pangram
查看原文 →