pg_temporal_tables
pg_temporal_tables · Temporal tables with transparent historical queries and user tracking
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102189 | pg_temporal_tables | pg_temporal_tables | 0.1.1 | TIME | MIT | C |
PostgreSQL · 18
Usage
Sources:
pg_temporal_tables records row history and rewrites queries for a selected historical time. The current implementation targets PostgreSQL 18 and requires preload and a server restart.
Core Workflow
Operational Boundaries
A tracked table needs a primary key. temporal.enable() creates history tracking; temporal.disable() stops it. temporal.changes() and temporal.column_history() inspect changes; retention and compaction functions maintain history. Set temporal.user_id for attribution and reset temporal.as_of after historical reads. Track the root of a partitioned table; legacy inheritance and TimescaleDB hypertables are unsupported. Do not change or reuse primary keys without reviewing the lineage option. Installation requires a superuser. Back up the history together with the base data and review retention before deleting history.