table_log
record table modification logs and PITR for table/row
Repository
df7cb/table_log
https://github.com/df7cb/table_log
Source
table_log-0.6.4.tar.gz
table_log-0.6.4.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
table_log | 0.6.4 | ADMIN | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5860 | table_log | No | Yes | No | Yes | No | No | - |
| Related | pgmemento pgaudit pg_drop_events data_historization table_version pgelog ddl_historization pgauditlogtofile pg_auditor pg_roast |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 0.6.4 | 1817161514 | table_log | - |
| RPM | PIGSTY | 0.6.4 | 1817161514 | table_log_$v | - |
| DEB | PGDG | 0.6.4 | 1817161514 | postgresql-$v-tablelog | - |
Build
You can build the RPM packages for table_log using pig build:
Install
You can install table_log directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
table_log: record table modification logs and PITR for table/row
The table_log extension records INSERT, UPDATE, and DELETE operations on a table into a separate log table, enabling point-in-time recovery at the table or row level.
Initialize Logging
Log Table Structure
The log table mirrors the original table columns plus metadata:
| Column | Description |
|---|---|
trigger_mode | Operation type: INSERT, UPDATE, DELETE |
trigger_tuple | Tuple version: ‘old’ or ’new’ |
trigger_changed | Timestamp of the change |
trigger_id | Sequential ID (level 4+) |
trigger_user | User who made the change (level 5) |
Point-in-Time Restore
Trigger Functions
| Function | Description |
|---|---|
table_log() | Full trigger function logging all columns |
table_log_basic() | Basic trigger function with simpler logging |
table_log_restore_table(...) | Restore table state to a given timestamp |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)