data_historization
PLPGSQL Script to historize data in partitionned table
data_historization : PLPGSQL Script to historize data in partitionned table
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4320 | data_historization | data_historization | 1.1.0 |
UTIL | PostgreSQL | SQL |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| ----dt- | No | No | No | Yes | no | yes |
| Relationships | |
|---|---|
| Requires | plpgsql |
| See Also | table_log pgmemento table_version temporal_tables periods ddl_historization emaj pgaudit pg_drop_events pgauditlogtofile |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.0 |
18 17 16 15 14 | data_historization |
plpgsql |
| RPM | PIGSTY | 1.1.0 |
18 17 16 15 14 | data_historization_$v |
- |
| DEB | PIGSTY | 1.1.0 |
18 17 16 15 14 | postgresql-$v-data-historization |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| el8.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| el9.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| el9.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| el10.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| el10.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| d12.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| d12.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| d13.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| d13.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| u22.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| u22.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| u24.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| u24.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| u26.x86_64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
| u26.aarch64 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 | PIGSTY 1.1.0 |
Source
github.com/rodo/postgresql-data-historization
postgresql-data-historization-1.1.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
data_historization: Track data changes in partitioned log tables
PL/pgSQL scripts to historize data changes into partitioned tables.
Initialize Historization
Set up the necessary objects for a table (no data collected yet):
Start Historization
Install triggers to begin collecting changes into the _log table:
Stop Historization
Remove triggers and stop collecting changes:
Reset Historization
Remove cron entries and columns created on the source table:
Clean Historization
Remove the log table entirely:
Partition Management
Create and drop partitions manually:
Automate with pg_cron: