ddl_historization
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
ddl_historization | 0.0.7 | UTIL | GPL-2.0 | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4310 | ddl_historization | No | No | No | Yes | No | No | - |
| Related | plpgsql pg_readme data_historization table_version gzip bzip zstd http pg_net |
|---|---|
| Depended By | schedoc |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.0.7 | 1817161514 | ddl_historization | plpgsql |
| RPM | PIGSTY | 0.0.7 | 1817161514 | ddl_historization_$v | - |
| DEB | PIGSTY | 0.0.7 | 1817161514 | postgresql-$v-ddl-historization | - |
Build
You can build the RPM / DEB packages for ddl_historization using pig build:
pig build pkg ddl_historization # build RPM / DEB packages
Install
You can install ddl_historization directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install ddl_historization; # Install for current active PG version
pig ext install -y ddl_historization -v 18 # PG 18
pig ext install -y ddl_historization -v 17 # PG 17
pig ext install -y ddl_historization -v 16 # PG 16
pig ext install -y ddl_historization -v 15 # PG 15
pig ext install -y ddl_historization -v 14 # PG 14
dnf install -y ddl_historization_18 # PG 18
dnf install -y ddl_historization_17 # PG 17
dnf install -y ddl_historization_16 # PG 16
dnf install -y ddl_historization_15 # PG 15
dnf install -y ddl_historization_14 # PG 14
apt install -y postgresql-18-ddl-historization # PG 18
apt install -y postgresql-17-ddl-historization # PG 17
apt install -y postgresql-16-ddl-historization # PG 16
apt install -y postgresql-15-ddl-historization # PG 15
apt install -y postgresql-14-ddl-historization # PG 14
Create Extension:
CREATE EXTENSION ddl_historization CASCADE; -- requires: plpgsql
Usage
ddl_historization: Track all DDL changes in a PostgreSQL database
Records all DDL changes (CREATE, ALTER, DROP, etc.) made on a database into a historization table for auditing and tracking purposes.
Setup
CREATE EXTENSION ddl_historization;
The extension installs event triggers that automatically capture DDL statements and store them in the historization table.
Querying DDL History
After installation, all DDL changes are logged automatically. Query the history table to see what changes have been made:
SELECT * FROM ddl_history ORDER BY ddl_date DESC;
Integration with pg_tle
For AWS RDS environments, the extension can be deployed via pg_tle:
-- Build the pg_tle deployment file
-- $ make pgtle
-- Then execute pgtle.ddl_historization-0.3.sql on your instance
Notes
- DDL statements are captured via PostgreSQL event triggers
- Works with
CREATE,ALTER,DROP, and other DDL commands - Used as a dependency by the
schedocextension for schema documentation
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.