ddl_historization

Historize the ddl changes inside PostgreSQL database

Overview

PackageVersionCategoryLicenseLanguage
ddl_historization0.0.7UTILGPL-2.0SQL
IDExtensionBinLibLoadCreateTrustRelocSchema
4310ddl_historizationNoNoNoYesNoNo-
Relatedplpgsql pg_readme data_historization table_version gzip bzip zstd http pg_net
Depended Byschedoc

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY0.0.71817161514ddl_historizationplpgsql
RPMPIGSTY0.0.71817161514ddl_historization_$v-
DEBPIGSTY0.0.71817161514postgresql-$v-ddl-historization-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
el8.aarch64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
el9.x86_64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
el9.aarch64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
el10.x86_64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
el10.aarch64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
d12.x86_64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
d12.aarch64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
d13.x86_64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
d13.aarch64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
u22.x86_64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
u22.aarch64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
u24.x86_64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
u24.aarch64
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7
PIGSTY 0.0.7

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 schedoc extension for schema documentation

Last Modified 2026-03-12: add pg extension catalog (95749bf)