pgmemento
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgmemento | 0.7.4 | SEC | LGPL-3.0 | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 7190 | pgmemento | No | No | No | Yes | No | No | pgmemento |
| Related | table_log pgaudit table_version data_historization ddl_historization pg_drop_events periods temporal_tables emaj pgelog |
|---|
Packages upgrade scripts from 0.7, 0.7.1, 0.7.2, and 0.7.3 to 0.7.4.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.7.4 | 1817161514 | pgmemento | - |
| RPM | PIGSTY | 0.7.4 | 1817161514 | pgmemento_$v | - |
| DEB | PIGSTY | 0.7.4 | 1817161514 | postgresql-$v-pgmemento | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.7.4 el8.x86_64.pg18 : pgmemento_18 pgmemento_18-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.x86_64.pg17 : pgmemento_17 pgmemento_17-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.x86_64.pg16 : pgmemento_16 pgmemento_16-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.x86_64.pg15 : pgmemento_15 pgmemento_15-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.x86_64.pg14 : pgmemento_14 pgmemento_14-0.7.4-1PIGSTY.el8.noarch.rpm
|
| el8.aarch64 | PIGSTY 0.7.4 el8.aarch64.pg18 : pgmemento_18 pgmemento_18-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.aarch64.pg17 : pgmemento_17 pgmemento_17-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.aarch64.pg16 : pgmemento_16 pgmemento_16-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.aarch64.pg15 : pgmemento_15 pgmemento_15-0.7.4-1PIGSTY.el8.noarch.rpm
| PIGSTY 0.7.4 el8.aarch64.pg14 : pgmemento_14 pgmemento_14-0.7.4-1PIGSTY.el8.noarch.rpm
|
| el9.x86_64 | PIGSTY 0.7.4 el9.x86_64.pg18 : pgmemento_18 pgmemento_18-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.x86_64.pg17 : pgmemento_17 pgmemento_17-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.x86_64.pg16 : pgmemento_16 pgmemento_16-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.x86_64.pg15 : pgmemento_15 pgmemento_15-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.x86_64.pg14 : pgmemento_14 pgmemento_14-0.7.4-1PIGSTY.el9.noarch.rpm
|
| el9.aarch64 | PIGSTY 0.7.4 el9.aarch64.pg18 : pgmemento_18 pgmemento_18-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.aarch64.pg17 : pgmemento_17 pgmemento_17-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.aarch64.pg16 : pgmemento_16 pgmemento_16-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.aarch64.pg15 : pgmemento_15 pgmemento_15-0.7.4-1PIGSTY.el9.noarch.rpm
| PIGSTY 0.7.4 el9.aarch64.pg14 : pgmemento_14 pgmemento_14-0.7.4-1PIGSTY.el9.noarch.rpm
|
| el10.x86_64 | PIGSTY 0.7.4 el10.x86_64.pg18 : pgmemento_18 pgmemento_18-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.x86_64.pg17 : pgmemento_17 pgmemento_17-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.x86_64.pg16 : pgmemento_16 pgmemento_16-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.x86_64.pg15 : pgmemento_15 pgmemento_15-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.x86_64.pg14 : pgmemento_14 pgmemento_14-0.7.4-1PIGSTY.el10.noarch.rpm
|
| el10.aarch64 | PIGSTY 0.7.4 el10.aarch64.pg18 : pgmemento_18 pgmemento_18-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.aarch64.pg17 : pgmemento_17 pgmemento_17-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.aarch64.pg16 : pgmemento_16 pgmemento_16-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.aarch64.pg15 : pgmemento_15 pgmemento_15-0.7.4-1PIGSTY.el10.noarch.rpm
| PIGSTY 0.7.4 el10.aarch64.pg14 : pgmemento_14 pgmemento_14-0.7.4-1PIGSTY.el10.noarch.rpm
|
| d12.x86_64 | PIGSTY 0.7.4 d12.x86_64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.x86_64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.x86_64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.x86_64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.x86_64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
|
| d12.aarch64 | PIGSTY 0.7.4 d12.aarch64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.aarch64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.aarch64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.aarch64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
| PIGSTY 0.7.4 d12.aarch64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~bookworm_all.deb
|
| d13.x86_64 | PIGSTY 0.7.4 d13.x86_64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.x86_64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.x86_64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.x86_64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.x86_64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
|
| d13.aarch64 | PIGSTY 0.7.4 d13.aarch64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.aarch64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.aarch64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.aarch64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
| PIGSTY 0.7.4 d13.aarch64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~trixie_all.deb
|
| u22.x86_64 | PIGSTY 0.7.4 u22.x86_64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.x86_64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.x86_64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.x86_64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.x86_64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
|
| u22.aarch64 | PIGSTY 0.7.4 u22.aarch64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.aarch64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.aarch64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.aarch64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
| PIGSTY 0.7.4 u22.aarch64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~jammy_all.deb
|
| u24.x86_64 | PIGSTY 0.7.4 u24.x86_64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.x86_64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.x86_64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.x86_64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.x86_64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~noble_all.deb
|
| u24.aarch64 | PIGSTY 0.7.4 u24.aarch64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.aarch64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.aarch64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.aarch64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~noble_all.deb
| PIGSTY 0.7.4 u24.aarch64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~noble_all.deb
|
| u26.x86_64 | PIGSTY 0.7.4 u26.x86_64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.x86_64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.x86_64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.x86_64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.x86_64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
|
| u26.aarch64 | PIGSTY 0.7.4 u26.aarch64.pg18 : postgresql-18-pgmemento postgresql-18-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.aarch64.pg17 : postgresql-17-pgmemento postgresql-17-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.aarch64.pg16 : postgresql-16-pgmemento postgresql-16-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.aarch64.pg15 : postgresql-15-pgmemento postgresql-15-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
| PIGSTY 0.7.4 u26.aarch64.pg14 : postgresql-14-pgmemento postgresql-14-pgmemento_0.7.4-1PIGSTY~resolute_all.deb
|
Build
You can build the RPM / DEB packages for pgmemento using pig build:
pig build pkg pgmemento # build RPM / DEB packages
Install
You can install pgmemento 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 pgmemento; # Install for current active PG version
pig ext install -y pgmemento -v 18 # PG 18
pig ext install -y pgmemento -v 17 # PG 17
pig ext install -y pgmemento -v 16 # PG 16
pig ext install -y pgmemento -v 15 # PG 15
pig ext install -y pgmemento -v 14 # PG 14
dnf install -y pgmemento_18 # PG 18
dnf install -y pgmemento_17 # PG 17
dnf install -y pgmemento_16 # PG 16
dnf install -y pgmemento_15 # PG 15
dnf install -y pgmemento_14 # PG 14
apt install -y postgresql-18-pgmemento # PG 18
apt install -y postgresql-17-pgmemento # PG 17
apt install -y postgresql-16-pgmemento # PG 16
apt install -y postgresql-15-pgmemento # PG 15
apt install -y postgresql-14-pgmemento # PG 14
Create Extension:
CREATE EXTENSION pgmemento;
Usage
Sources:
pgmemento is a trigger-based audit trail for PostgreSQL. It records DML changes as JSONB deltas, groups them by transaction and table event, tracks audited schema changes, and provides restore and revert helpers. Use it when row history and transaction context must be queried inside PostgreSQL.
Create and Initialize
CREATE EXTENSION pgmemento;
SELECT pgmemento.init('public');
init instruments eligible tables in the selected schema and adds the pgmemento_audit_id identity column used to track row history. Run it first on a staging copy: auditing changes table definitions and installs event and row triggers.
Use start and stop to control auditing for a schema, and use the documented drop function when intentionally removing pgMemento’s instrumentation. Do not manually delete extension triggers or audit identifiers.
Inspect the Audit Trail
The central data model includes:
- transaction_log: transaction metadata and optional application context.
- table_event_log: table-level events within a transaction.
- row_log: JSONB row deltas linked to a table event.
- audited_schema and audited_table metadata: tracked schemas, tables, columns, and versions.
A typical investigation joins a transaction to its table events and row deltas:
SELECT t.id,
t.txid_time,
e.table_operation,
r.audit_id,
r.old_data,
r.new_data
FROM pgmemento.transaction_log AS t
JOIN pgmemento.table_event_log AS e
ON e.transaction_id = t.id
JOIN pgmemento.row_log AS r
ON r.event_key = e.event_key
WHERE t.id = 12345;
Inspect the installed views and column names before embedding this query because audit schema details can differ across pgmemento versions.
Restore and Revert
pgmemento provides restore functions that reconstruct table state from the audit trail and revert_transaction or related helpers that apply compensating changes. Treat these as recovery operations:
- take and verify a backup;
- identify the exact transaction and dependent changes;
- preview reconstructed data where possible;
- run the operation in a controlled transaction;
- validate constraints, sequences, and application invariants.
Version 0.7.4
Version 0.7.4 changes row serialization to avoid PostgreSQL’s jsonb_build_object argument limit for very wide payloads and adds PostgreSQL 15 support. Upgrade using ALTER EXTENSION pgmemento UPDATE only after testing the version-specific upgrade script.
Operational Boundaries
- Audit triggers add latency and write volume to every tracked change. Monitor row_log growth and index maintenance.
- The audit trail resides in the same database and is not a substitute for backups, WAL archives, or tamper-resistant external audit storage.
- Schema initialization and DDL tracking alter application tables. Coordinate migrations with pgmemento rather than bypassing its event triggers.
- Limit direct writes to the pgmemento schema and protect any transaction metadata that can contain user or application information.
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.