PostgreSQL 扩展生态全景解析(第六期):AI 原生数据库 —— 扩展生态的终局与未来
Clyde Jin
04-24
DBA
36

PostgreSQL 扩展生态全景解析(第六期):AI 原生数据库 —— 扩展生态的终局与未来

引言:从五期旅程到 AI 原生之问

五期,五扇“门”,逐一打开。

第一期,我们站在入口,看见了 PostgreSQL 扩展生态的全貌——超过 1000 个扩展,从数据联邦到安全审计,从过程语言到性能监控。第二期,PostGIS 敞开了空间之门——数据库从此“看懂”地图:点、线、多边形,距离、包含、相交,一切地理概念都落在 SQL 里。第三期,pgvector 敞开了语义之门——高维向量变成原生数据类型,数据库从“匹配关键词”走向“理解含义”。第四期,TimescaleDB 敞开了时间之门——万亿级时序数据、自动分区、在线压缩、连续聚合,数据库从“被动存储时间”走向“主动驾驭时间之河”。第五期,我们推开分布式之门——Citus、FDW、存算分离、Kubernetes 原生——单机的天花板被打破,数据库的边界从一台机器扩展到一个集群、一片云、一个全球分布的系统。

五扇门之后,一个更根本的问题浮现出来:终点在哪里?

是 CAP 理论无法打破的分布式困境?是无止境的性能爬升?是越来越多新场景催生越来越多新扩展?都不是。

这条路走到这里会发现:PostgreSQL 的终极目标不是分布式的无限扩展,也不是时序或向量的单项性能巅峰,而是一个更宏大、更本质的方向——AI 原生数据库。一个能够同时处理空间、时间、关系和语义四种数据维度的数据库;一个让 AI 模型直接在数据所在地完成训练和推理的数据库;一个自己能感知工作负载、自动优化索引、自动调参的数据库;一个本身就能被 AI 智能体“使用”和“操作”的数据库。

这就是本系列收官的答案。

一、变迁简史:为什么 PostgreSQL 在 AI 时代成为首选?

1.1 2023 年:向量检索技术引爆 PostgreSQL 增长

时间回到 2023 年初,ChatGPT 的发布引发全球对 AI 应用的狂热追逐。RAG 架构迅速成为 LLM 落地的标准范式,而 RAG 的核心依赖于高效存储和检索高维嵌入向量。当时市场反应主要是两种:一是重新发明轮子——一批专用向量数据库——Pinecone、Milvus、Qdrant——迅速成为硅谷宠儿;二是让现有数据库变出来——PostgreSQL 已经有一个 2021 年发布的 pgvector 扩展,而这一年的时间点,恰好和 RAG 的热潮形成了一次完美的“范式共振”。

事实证明这不是巧合。专用向量数据库提供了更前沿的特性,但它们无法与业务数据在同一事务上下文中协同工作,凡涉及多系统联查时就要在“迁移所有数据入向量库”和“每次查询联两次系统”之间做艰难选择。pgvector 先天就在 PostgreSQL 内部运行,向量与标量数据在同一事务中,JOIN 时不需要应用层补偿。这份“开箱即用的整合”成为压倒性的优势。

接下来的两年是 PostgreSQL 在 AI 时代全面发力的两年。Stack Overflow 开发者调查显示,2023 年左右出现了“爆炸式的阶跃增长”,向量数据库这一波带飞了 PG,AI 把 PG 的增长拉到了一个新阶段。

而真正改变行业格局的,是各大云厂商的反应。2025 年,Google 正式宣布 AlloyDB AI 全面可用,将向量能力原生植入 PostgreSQL 兼容的云数据库;AWS 推出 Aurora PostgreSQL 与 SageMaker 的零 ETL 集成;Azure HorizonDB 号称“重新定义 PostgreSQL 性能极限”,AI 就写在它的底座里。这些行动从不同方向印证了同一个结论:PostgreSQL 正在成为 AI 应用开发的事实标准数据底座。

二、三阶跃迁:PostgreSQL AI 化的道路正在变成现实

2.1 第一阶:多模态融合(Multi-modal Convergence)

“多模态融合”是将标量、向量、文本、JSON、GIS 等不同数据类型在同一数据库内核中统一处理。传统架构将这些数据分散在多个系统中,数据孤岛、链路冗长、权限复杂。PostgreSQL 扩展体系天然实现了多模态融合:pgvector 管理向量,PostGIS 管理地理数据,B-tree 和 GIN 管理标量和文本,所有能力协同运作。SeekDB 等 AI 原生数据库已经证明了在单一数据库内实现跨模态查询的可行性——例如“近 7 天交易超 5 万元、位置异常且行为类似历史欺诈样本”这样的复杂条件在单条 SQL 中就能完成。

2.2 第二阶:AI 驱动自治(AI-driven Autonomy)

AI 驱动自治是数据库将自己的智能武装起来——让数据库“自己管自己”。工作负载感知:数据库自动识别热数据分片和冷热特征;自动索引推荐:基于历史查询模式自动创建和删除索引;资源动态分配:根据负载变化弹性调度计算和内存资源。Redgate 2026 年报告显示,AI 在数据库管理中的使用率从 15% 飙升至 44%,每年几乎翻了 3 倍。数据表明自治数据库不再是概念,而是正在快速铺开的现实。

2.3 第三阶:AI 智能体编程(Agentic Programming)

第三阶是将数据库的“使用者”从人变为 AI 智能体。Databricks 2026 年发布的《State of AI Agents》报告显示:在 Neon(Databricks 收购的云 PostgreSQL 平台)上,由 AI 智能体创建的数据库已从 2023 年 10 月的 0.1% 猛增到 2025 年 10 月的 80%;数据库分支的创建比例更是从 0.1% 暴涨至 97%。AI 智能体已在实际基础设施管理中占据主导位置。

三、云厂商的集体入局:从“兼容”到“原生”

3.1 Google AlloyDB AI:将向量嵌入数据库的深层架构

2026 年初全面推出,Google Cloud 在完整保留 PostgreSQL 兼容性的前提下重构了存储层,使事务、分析和向量三种负载在单一引擎中获得高性能。支持在复数个数据库中存储百万级向量并进行毫秒级检索。AlloyDB 已被 Regnology 等企业用于构建监管报告聊天机器人——AlloyDB 充当动态向量存储,实时索引监管指南和合规文档,合规分析师通过自然语言交互完成报告查询。Google 同时将向量搜索能力扩展到 Cloud SQL for MySQL、Memorystore for Redis 和 Spanner,在所有数据库产品中统一引入 AI 能力。

3.2 AWS 零 ETL 蓝图:打通数据孤岛

AWS 在 2025 年 12 月的 re:Invent 大会上推出了 Transform SQL,利用 LLM 自动将 SQL Server 数据库迁移到 Aurora PostgreSQL,向自动化迈出决定性一步。Aurora PostgreSQL 与 SageMaker 的零 ETL 集成则将数据从数据库“秒级”同步到 AI/ML 工作流中,无需额外开发和维护。

3.3 微软 Azure HorizonDB:重新定义性能边界

微软在 Ignite 2025 上发布的 Azure HorizonDB 完全托管 PostgreSQL 服务,专为 AI 工作负载设计。不止做兼容适配,而是将数据库与 Azure AI 服务深度整合。这是微软继收购 Citus 后在 PostgreSQL 生态中的又一次重大加注。

3.4 Pigsty v4.0:开源发行版的 AI 时代宣言

Pigsty 4.0 在 2026 年 2 月发布,在生态集成方面提供了 444 个扩展(PG 扩展目录已增长到 504 个)的开箱即用支持。最关键的是推出了 VIBE 模块,专门面向 AI 编程环境和 DBA Agent,支持 Claude Code 集成,并构筑了 PIGLET.RUN 运行时——一个代理化的 PostgreSQL AI 工作负载运行时。一个开源 PostgreSQL 发行版将自己完整武装为“AI 时代的基础设施”,正是 PostgreSQL 整体 AI 化的缩影。

四、AI 时代的 DBA:退场还是进化?

一个直击灵魂的问题:如果 AI 智能体已经能创建 80% 的数据库、管理 97% 的分支,DBA 的价值还有没有?答案是:不会消失,但角色会发生根本性转变。

AI 不会完全取代 DBA,但会重新定义 DBA 的价值边界。随着操作性知识被 AI 极大压缩甚至淘汰,传统的“写 SQL、建索引、看监控”这些工作将大量由 AI 接管。DBA 的溢价反而在于技术品味、系统架构思维与持续学习的能力的组合。

三组数字可以说明这种转变的剧烈程度:过去一年里,AI 在数据库管理中的采用率从 15% 跃升到 44%;58% 的组织表示愿为 AI 效率牺牲一定程度的数据安全;而 49% 的组织明确报告因 AI 采用而减少了对初级人员的招聘。这意味着 AI 不是在辅助人,而是在规模化替代某些具体工种。DBA 必须思考并随之进化。

五、展望:AI 原生数据库的终极蓝图

5.1 统一的智能数据平台

当前 PostgreSQL 扩展生态几乎已经具备了 AI 原生数据库所需的所有模块——pgvector 负责向量存储和检索,pgml 负责模型推理,PostGIS 负责空间计算,TimescaleDB 负责时序管理,Citus 负责分布式扩展——它们是可自由组合的微内核安装方式,区别于 AlloyDB 或 SeekDB 等封闭式、刚性集成的方案。

5.2 AI 扩展生态新动向

堆栈正在快速补位——PostgresML 2.10.0 引入了 GPU 加速和向量搜索优化,支持 Llama 3.2 的大模型推理;pg_vectorize 以两个函数调用完成从 RAG 到 LLM 全流程的封装;VectorChord 将向量索引的精度和存储效率推向更高层次;pg_ai_query 则以 0.1.1 版本刚刚加入生态。每条路都在指向同一个终点:让开发者用最少的重复劳动和最低的基础设施复杂度,在 PostgreSQL 上构建 AI 应用。

5.3 安全与治理的警示

AI Native 不是只有“甜头”。Redgate 报告揭示的核心警示是:66% 的受访者将数据安全与隐私列为首要关切,合规压力从 32% 上升到 40%,而 58% 的组织却宁愿在效率驱动下忍受更高安全风险。AI 应用的扩展速度如此之快,企业面对权力集中、权限泄露和未授权数据访问等一系列新的潜在风险,几乎没有经验可循。

这提醒我们:PostgreSQL 在 AI 时代的角色不只是更聪明,它的 ACID 事务和 MVCC 安全机制从未像现在这样重要。多模态数据汇聚在同一实例中是大势所趋,而每一个向量查询的权限,必须被标准化地控制。

六、结语:从 CREATE EXTENSION 到 CREATE INTELLIGENCE

六期,六扇门。

第一期,我们看见一个数据库可以通过扩展长出无数能力。第二期,PostGIS 让数据库理解“空间”——“它在哪里”。第三期,pgvector 让数据库理解“语义”——“它像什么”。第四期,TimescaleDB 让数据库理解“时间”——“它何时发生”。第五期,分布式扩展让数据库打破物理极限——“它有无限边界”。第六期,我们终于看见这些能力的交汇——空间、时间、语义——不是三类独立的扩展,而是一个完整的智能平台。

2023 年以前,PostgreSQL 的扩展定位是:“把通用数据库改造成专用数据库”——用 PostGIS 把它变成 GIS,用 TimescaleDB 把它变成时序数据库。但 AI 时代 PostgreSQL 的扩展定位正在发生一次反转,从“专用化”走向更高层的融合:不是“把它变成 X 数据库”,而是“用同一套 SQL 同时查询空间、时间和语义”。

PostgreSQL 扩展生态的终局不是某个具体技术突破,而是一个根本性的范式转变:数据库不再是应用的被动存储,而是 AI 主动计算的一部分。 你 INSERT 的不再是行,而是可供检索和推理的知识;你 SELECT 的不再是字段,而是启发决策和行动的情报。

CREATE EXTENSIONCREATE INTELLIGENCE——这就是人工智能时代里,PostgreSQL 的终局。

而本系列六期走过的,正是那场从“存储一切”走向“计算一切”的路径。

参考文献

[1] 冯若航,Pigsty 作者. 当 PostgreSQL 遇见 AI,数据库的 AI 进化论. 极客公园. 2026.

[2] Databricks. State of AI Agents 2026 Report. 2026.

[3] Redgate. 2026 State of the Database Landscape Report. 2026.

[4] OceanBase. SeekDB:AI 原生数据库的技术革命与实践指南. 腾讯云. 2026.

[5] Pigsty. Pigsty v4.0 Release Announcement. PostgreSQL Global Development Group. 2026.

[6] Google Cloud. AlloyDB AI: Building Enterprise GenAI Applications. SDxCentral. 2026.

[7] AWS. Aurora PostgreSQL Zero-ETL Integration with SageMaker. 2025.

[8] Microsoft. Azure HorizonDB Announcement. Ignite 2025.

[9] AI工作负载推动数据库重返Postgres. 至顶网. 2026.

[10] 從 RAG 蛻變重生到 PostgreSQL 崛起—資料領域 6 大變革正瞄準企業 AI. TechOrange. 2026.

[11] RockData. PostgreSQL: The Preferred Database in the AI Era. 2026.

[12] AWS. AWS Transform SQL: Agentic AI-Powered Database Migration. 2026.

[13] PostgresML. PostgresML 2.10.0 Release. 2025.

[14] 2025开源数据库峰会:AI驱动数据库技术新突破. 开发者头条. 2026.

[15] pg_vectorize. pg_vectorize 0.23.0 Release. PGXN. 2025.

[16] Pigsty. Pigsty v4.0:当PostgreSQL发行版正式迈入AI时代. 博客园. 2026.

Star
Donate
PostgreSQL 扩展生态全景解析(第五期):分布式扩展 —— 从分片到存算分离的进化之路
Previous
PostgreSQL 运维实战系列,第一期:从零开始构建生产级数据库环境
Next

Leave a comment

Registration is not required

Clyde Jin
302 Articles
0 Comments
0 Like
Recent Posts

HiddenMerit Daily · Issue 59

📊 HiddenMerit Daily · Issue 59 Focus on Database Frontiers, Practical Insights for DBAs July 21, 2026 | 5 Selected Global Breaking News 01|Oracle Issues Urgent Warning: July 21 Release Update to Fix Large Number of High‑Risk Vulnerabilities, Immediate Deployment Recommended On July 13, Oracle issued an urgent security warning, strongly recommending that all customers running supported Oracle Database versions (including Oracle Database 19c and Oracle AI Database 26ai) immediately test and deploy the Release Update (RU) after its release on July 21. Background: New frontier AI models are significantly lowering the barrier to discovering and exploiting software vulnerabilities – these models can identify weaknesses, analyse software changes, reverse‑engineer security patches, and develop potential attack paths at unprecedented speed and scale. AI models are also becoming increasingly adept at combining multiple weaknesses across the application and data stack into complex attacks, even when individual weaknesses do not themselves pose a serious risk. As a result, protecting systems solely at the network or application layer is no longer sufficient; enterprises must protect the entire technology stack. Fixes Included in This RU: Oracle has collaborated with state‑of‑the‑art models from Anthropic and OpenAI to proactively identify and fix potential security vulnerabilities. The upcoming […]

HiddenMerit Daily · Issue 58

📊 HiddenMerit Daily · Issue 58 Focus on Database Frontiers, Practical Insights for DBAs July 20, 2026 | 5 Selected Global Breaking News 01|CAICT: Domestic Databases Enter Core System “Deep Water,” AI‑Native Leads New Industry Landscape On July 9, at the 2026 Trustworthy Database Development Conference, CAICT released the “Database Development Research Report (2026).” The report notes that domestic databases have basically completed peripheral system replacement and have officially entered the critical business system breakthrough phase. Key Data: The global database market reached $131.6 billion in 2025 (approximately RMB 894.09 billion). The Chinese database market reached $9.49 billion in 2025 (approximately RMB 64.48 billion), and is expected to reach RMB 97.974 billion by 2028, with a CAGR of 13.06%. The number of domestic database vendors has shrunk from a peak of 167 to 94, with a clear head‑concentration effect and an intensifying “Matthew effect.” AI‑Native Becomes the Main Theme: The report points out that database technology is accelerating its evolution toward the AI‑native direction, and the global database industry is entering a new phase of landscape restructuring. The role of databases is upgrading from “underlying support systems” to “core engines enabling intelligent decision‑making and business innovation.” AI agents are becoming […]

HiddenMerit Daily · Issue 56

📊 HiddenMerit Daily · Issue 56 Focus on Database Frontiers, Practical Insights for DBAs July 6, 2026 | 5 Selected Global Breaking News 01|Kingware Releases Manufacturing Scenario Database Evolution White Paper: SQL Server Replacement Enters “Deep Water” On July 5, CETC Kingware published a technical article titled “Database Evolution in Manufacturing Scenarios: How Kingware Replaces SQL Server,” pointing out that the data surge on industrial shop floors has exceeded the processing capacity of single‑node systems. Traditional database architectures that rely on vertical scaling are facing unprecedented performance challenges. Over the next 1‑3 years, manufacturing enterprises will no longer face only the “choice of replacement,” but must answer the strategic question: “How do we build an autonomous data foundation in the context of de‑IOE?” Three Paradigm Shifts: Hybrid Workloads Become the Norm: The IT architecture of modern factories is shifting from separated OLTP and OLAP to HTAP mode. The same data system must simultaneously handle tens of thousands of device instruction writes per second and minute‑level production report analysis. Distributed Architecture Becomes a Hard Requirement: When a single table exceeds 100 million rows with daily increments exceeding 1 million rows, the index maintenance cost of traditional single‑node databases rises exponentially. Autonomous […]

HiddenMerit Daily · Issue 57

📊 HiddenMerit Daily · Issue 57 Focus on Database Frontiers, Practical Insights for DBAs July 17, 2026 | 5 Selected Global Breaking News 01|CAICT Releases “Database Development Research Report (2026)”: China Market to Reach RMB 98 Billion by 2028, AI‑Native Becomes the Main Theme On July 9, at the 2026 Trustworthy Database Development Conference, the China Academy of Information and Communications Technology (CAICT) officially released the “Database Development Research Report (2026),” comprehensively revealing the latest landscape and evolution directions of the global and Chinese database markets. Key Data: Global Market: The global database market reached $131.6 billion in 2025 (approximately RMB 894.09 billion). Chinese Market: The Chinese database market reached $9.49 billion in 2025 (approximately RMB 64.48 billion), accounting for 7.2% of the global market. By 2028, the total Chinese database market is expected to reach RMB 97.974 billion, with a compound annual growth rate of 13.06% . Industry Landscape: There are 394 database product providers globally, with China and the US leading in vendor count. The number of global open‑source and closed‑source products is roughly balanced. Commercial databases account for over 70% in China, while the proportion of open‑source databases is increasing. After rapid growth from 2022 to 2024, […]
生成中...
扫描二维码
扫描二维码