documentdb
documentdb : API surface for DocumentDB for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 9000 | documentdb | documentdb | 1.2 |
SIM | MIT | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-- | No | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | documentdb_api documentdb_api_internal documentdb_api_catalog documentdb_data documentdb_api_v2 documentdb_api_internal_admin documentdb_api_internal_readwrite documentdb_api_internal_readonly documentdb_api_internal_bgworker |
| Requires | documentdb_core pg_cron postgis tsm_system_rows vector |
| Need By | documentdb_extended_rum |
| See Also | pgbson jsquery pg_projection mongo_fdw pgjq pg_graphql omni_rest pg_jsonschema pg_net jsonschema |
| Siblings | documentdb_core documentdb_extended_rum |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.2 |
19 18 17 16 15 | documentdb |
documentdb_core, pg_cron, postgis, tsm_system_rows, vector |
| 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 |
Source
github.com/documentdb/documentdb
documentdb-1.2-0.tar.gz intelrdfpmath-applied-2.0u3-1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
- DocumentDB v1.0-0 README
- DocumentDB v1.0-0 changelog
documentdbcontrol file- Official preload helper
- DocumentDB 1.0 release
- DocumentDB 1.2 release
- 1.2 control
- 1.1 to 1.2 SQL
- Official upgrade procedure
documentdb is the public PostgreSQL API extension for DocumentDB, an open-source MongoDB-compatible document database built on PostgreSQL. It stores BSON documents and implements CRUD, aggregation, full-text, geospatial, and vector workflows. MongoDB drivers require the separate DocumentDB gateway; installing this extension alone exposes the PostgreSQL API, not a wire-protocol listener.
Configure and Install
The official deployment helper preloads the core and API libraries with pg_cron. Restart PostgreSQL after changing this setting:
Install the public extension and its declared dependencies:
CASCADE can install documentdb_core, pg_cron, tsm_system_rows, vector, and postgis when their files are present. Installation is superuser-only and non-relocatable.
Native SQL Workflow
The SQL surface uses a database name, collection name, and BSON command document:
For application compatibility, run the gateway and use a supported MongoDB driver against its configured TLS endpoint. The gateway translates wire-protocol commands into this PostgreSQL API.
Important Objects
documentdb_apicontains collection-management and command functions such ascreate_collectionandinsert_one.documentdb_api_catalog.bson_aggregation_findexecutes a MongoDB-style find specification and returns BSON documents.documentdb_core.bsonis the storage and interchange type supplied bydocumentdb_core.- DocumentDB roles and internal schemas separate public read/write operations from administrative and implementation objects.
documentdb.enableNonBlockingUniqueIndexBuildcontrols the v0.114 path for background unique ordered-index builds and is enabled by default in that release.
Version and Operational Notes
Release 1.0-0 adds the first generally available release line. It fixes permission checks for zero-batch reads and write permissions for merge/output targets, along with crash, geospatial ordering and index-vacuum bugs. Custom role CRUD and post-join nested lookup remain disabled by default behind their settings. Match all libraries and apply the release upgrade SQL.
The official DocumentDB Local container enables usage telemetry by default; native packages are unaffected. Set DOCUMENTDB_USAGE_TELEMETRY=false, NO_ANALYTICS=1 or DO_NOT_TRACK=1 to disable it in the container.
MongoDB compatibility is not identical to every MongoDB server version. Test operators, index behavior, transactions, schema validation, authentication, and driver behavior used by the application. Match documentdb, documentdb_core, gateway, and optional distributed/index components to the same release line.
DocumentDB 1.2 changes
DocumentDB 1.2 uses SQL version 1.2-0. Back up the data directory before upgrading; reverting upgraded data to 1.0 is not supported. The official 1.2 container updates extensions before starting the gateway and refuses startup without an explicit password, including on an existing volume. For an adopted PostgreSQL instance, follow the package guide’s restart and update sequence rather than restarting or altering unrelated instances.
Collation remains disabled unless documentdb_core.enableCollation = on, even for explicit simple collation. Collated non-unique indexes additionally require documentdb.enableCollationWithNonUniqueOrderedIndexes; collated unique indexes also require documentdb.enable_collated_unique_indexes and documentdb.enable_composite_unique_optional_key. The release adds per-command/per-update collation behavior and fixes descending unique-index null/missing conflicts, $dateTrunc day boundaries and rescanned $densify results. Review affected query and index semantics after upgrading.