timeql
timeql · Native temporal history tracking and point-in-time queries using PostgreSQL range types and GiST indexes.
Overview
Usage
Sources:
- Official upstream README
- Official extension control file (timeql.control)
- Official extension SQL (timeql–1.0.sql)
timeql — TimeQL is a PostgreSQL extension that provides native, high-performance temporal data tracking and “Point-in-Time” querying capabilities. It uses PostgreSQL’s native Range Types (tsrange) and GiST indexing to ensure that tracking your data’s history doesn’t kill your performance. Use it for the corresponding scheduling, temporal, or time-series workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
timeql.create_history_table(p_schema TEXT, p_table TEXT)is an extension function and returnsvoid.timeql.create_history_table(p_schema TEXT, p_table TEXT, p_retention_period INTERVAL DEFAULT NULL)is an extension function and returnsvoid.timeql.disable_temporal(p_schema TEXT, p_table TEXT)is an extension function and returnsvoid.timeql.enable_temporal(p_schema TEXT, p_table TEXT)is an extension function and returnsvoid.timeql.purge_all_history()is an extension function and returnsvoid.timeql.purge_history(p_schema TEXT, p_table TEXT)is an extension function and returnsvoid.timeql.restore_at(p_table_reg regclass, p_pk_value ANYELEMENT, p_timestamp TIMESTAMP WITHOUT TIME ZONE)is an extension function and returnsvoid.timeql.set_retention_policy(p_schema TEXT, p_table TEXT, p_retention_period INTERVAL)is an extension function and returnsvoid.timeql.tql_at(p_table_reg regclass, p_timestamp TIMESTAMP WITHOUT TIME ZONE)is an extension function and returnsSETOF.timeql.tql_between(p_table_reg regclass, p_start TIMESTAMP WITHOUT TIME ZONE, p_end TIMESTAMP WITHOUT TIME ZONE)is an extension function and returnsSETOF.timeql.track_delete()is an extension function and returnsTRIGGER.timeql.track_insert()is an extension function and returnsTRIGGER.timeql.track_update()is an extension function and returnsTRIGGER.timeql_version()is an extension function and returnstext.
Requirements and Caveats
- The reviewed control file declares default version
1.0. - The control file marks the extension as non-relocatable.
- The control file requires a superuser for installation.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.