pg_bitemporal
pg_bitemporal · Bitemporal table management and Allen interval relations
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102206 | pg_bitemporal | pg_bitemporal | 0.1 | TIME | C |
| Relationships | |
|---|---|
| Requires | btree_gist |
Usage
Sources:
pg_bitemporal combines interval-relation functions with triggers that retain system-time history. Full mode also stores application-supplied valid time; system-only mode tracks database changes.
Core Workflow
Operational Boundaries
The README requires PostgreSQL 14 or later and btree_gist; no complete major-version test matrix is published. Native functions require administrator installation. bitemporal.enable alters the target table, adds temporal columns and indexes, installs exclusion constraints and a trigger, and requires the corresponding table privileges. Use the actual SQL parameter p_mode. Updates close the old version and insert another; deletes close the current version instead of physically removing it. Query current rows with sys_end = 'infinity'; historical rows remain in the table and require storage planning. Full mode adds valid_from, valid_to and valid_range, whose values the application supplies. allen_relation, allen_relation_code and the thirteen predicate functions operate on range values. The extension creates a fixed bitemporal schema even though its control declares relocatability.