documentdb_core
documentdb · 微软DocumentDB的核心API层实现
概览
| ID | 扩展 | 软件包 | 版本 | 类别 | 许可证 | 编程语言 |
|---|---|---|---|---|---|---|
| 9010 | documentdb_core | documentdb | 1.2 | SIM | MIT | C |
| 属性 | 可执行文件 | 动态库 | 需要预加载 | 需要建扩展 | 可迁移 | 可信 |
|---|---|---|---|---|---|---|
| --sLd-- | 否 | 是 | 是 | 是 | 否 | 否 |
| 关联 | |
|---|---|
| 模式 | documentdb_core |
| 被依赖 | documentdb |
| 相关扩展 | mongo_fdw pg_projection pgbson jsquery pgjq pg_jsonschema jsonschema |
| 同包扩展 | documentdb documentdb_extended_rum |
软件包
| 类型 | 仓库 | 版本 | 兼容的 PostgreSQL 大版本 | 包名模式 | 依赖 |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.2 | 19 18 17 16 15 | documentdb | - |
| RPM | PIGSTY | 1.2 | 19 18 17 16 15 | documentdb_$v | postgresql$v-contrib, pg_cron_$v, pgvector_$v, rum_$v, postgis37_$v |
| DEB | PIGSTY | 1.2 | 19 18 17 16 15 | postgresql-$v-documentdb | postgresql-$v-cron, postgresql-$v-pgvector, postgresql-$v-rum, postgresql-$v-postgis-3 |
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| el8.aarch64 | N/A | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| el9.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| el9.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| el10.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| el10.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| d12.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 0.117 |
| d12.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 0.117 |
| d13.x86_64 | PIGSTY 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| d13.aarch64 | PIGSTY 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u22.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 0.117 |
| u22.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 0.117 |
| u24.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 0.117 |
| u24.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 0.117 |
| u26.x86_64 | PIGSTY 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u26.aarch64 | PIGSTY 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
源码
github.com/documentdb/documentdb
documentdb-1.2-0.tar.gz
intelrdfpmath-applied-2.0u3-1.tar.gz
安装
将扩展加入 shared_preload_libraries,详见配置说明。
在数据库中创建扩展。
用法
来源:
- DocumentDB v1.0-0 README
documentdb_core控制文件- BSON SQL定义
- 官方预加载助手
- DocumentDB 1.2 release
- 1.2 control
- 1.1 to 1.2 SQL
- Official upgrade procedure
documentdb_core 是DocumentDB使用的低层BSON类型和操作符层。通常它作为 documentdb 的依赖项安装,自身不提供集合CRUD、MongoDB网络协议或网关。
配置与安装
必须通过 shared_preload_libraries 加载 pg_documentdb_core,然后重启PostgreSQL:
对于完整的单节点堆栈,官方助手还会预加载 pg_cron 和 pg_documentdb。在常规部署中安装父扩展:
直接安装仅适用于低层BSON工作:
该扩展为超级用户专用且不可重定位。
BSON 工作流
除非 documentdb_core 在 search_path 中,否则请显式使用模式限定名。
重要对象
documentdb_core.bson存储BSON文档。documentdb_core.bsonquery表示用于DocumentDB计划器和操作符层的BSON查询值。documentdb_core.bsonsequence表示BSON值序列。bson_get_value和bson_get_value_text,通过->和->>也暴露出来,从BSON文档中提取路径。bson_from_bytea,bson_to_bytea,bson_json_to_bson和bson_to_json_string支持序列化边界。bson_btree_ops和bson_hash_ops提供更高层所需的比较和哈希支持。
操作边界
BSON比较、索引和数值语义遵循DocumentDB的实现,不应假设与PostgreSQL jsonb 匹配。大多数对象是 documentdb 的基础架构;寻求集合和MongoDB命令的应用程序应使用父扩展或网关而非直接构建在内部类型上。
使用 SQL 扩展版本 1.0-0,并与其他 DocumentDB 组件保持匹配。核心层仍提供 BSON 基础能力,集合操作和网关工作流由上层扩展承担。
DocumentDB 1.2 变化
1.2 源码将 documentdb_core 的 SQL 版本设为 1.2-0,并提供 1.0 → 1.1 → 1.2 升级链。备份数据后,应按官方包或容器流程,与 API 和索引组件一起升级;不支持将升级后的数据降回 1.0。bson_build_document 现在可把 timestamptz 转成毫秒精度 BSON 日期。排序规则仍需显式设置 documentdb_core.enableCollation = on,关闭时也会拒绝显式 simple 排序规则。启用后应测试受比较语义影响的应用查询。