pg_dms
pg_dms · Document management system with custom ID, family, and reference types plus action tracking and JSON registry helpers.
Overview
Usage
Sources:
- Pinned upstream README
- Version 0.0.1 installation SQL
- Pinned C implementation
- Pinned regression example
- Pinned extension control file
pg_dms version 0.0.1 is an application-specific document management data model. It implements pg_dms_id, pg_dms_family, and pg_dms_ref types, cross-type B-tree comparisons, UUID casts, embedded action histories, record JSON and hash helpers, and registry import/export tables and triggers. It is not a general document store.
Identifier and action example
A pg_dms_id text value consists of two UUIDs separated by an underscore. A new ID records the creating role and transaction-start timestamp. Each setaction call appends another action structure to the variable-length value, so indexed keys and row size grow with history.
SQL safety, schema, and compatibility limits
The control file declares the extension relocatable, but its SQL hard-codes tables and functions in public and operators in pg_catalog. It also creates generic action_list and registry objects. Install only in an isolated application database after checking for name and operator conflicts; do not move the extension schema.
Registry helpers and triggers construct dynamic INSERT statements by concatenating JSON-supplied schema names, table names, column names, and values without identifier or literal quoting. Untrusted input can change the generated SQL. Revoke all functions and registry tables from PUBLIC, and do not use the import path until it has been replaced with parameterized, schema-allowlisted code.
Several C functions are declared IMMUTABLE even though they read the current role, transaction time, or current clock. The planner can cache or reorder those calls incorrectly. The record helpers depend on PostgreSQL internal tuple APIs, the SQL creates obsolete PostgreSQL-10-era table options, and no modern-major compatibility matrix is supplied.
The repository has not changed since 2018 and contains no license file. Treat it as unmaintained historical application code: build against the exact target server, inspect every created object and grant, validate binary ordering and hashing, and use only with independent backups and application-specific regression tests.