Skip to content

audit_stream

Postgres extension that emits audit-stream-py-compatible governance events on watched table CRUD via pg notify, plus a Python LISTEN bridge daemon. The database-tier governance producer for the Kinetic Gain Protocol Suite.

audit_stream · Postgres extension that emits audit-stream-py-compatible governance events on watched table CRUD via pg notify, plus a Python LISTEN bridge daemon. The database-tier governance producer for the Kinetic Gain Protocol Suite.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101283audit_streamaudit_stream0.1.0SECMITPython

Usage

Sources:

audit_stream — > A Postgres extension that turns any table-level CRUD into an audit-stream-py-compatible governance event — without writing one line of application code. Use it when implementing the corresponding security, audit, or access-control workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.

Core Workflow

CREATE EXTENSION audit_stream;
SELECT audit_stream.watch('decisions', 'decision_card_status_changed', 'procurement-api');

Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.

Important Objects

  • list_watches() is an extension function and returns TABLE.
  • unwatch(p_table TEXT) is an extension function and returns BOOLEAN.
  • watch(p_table TEXT, p_event_kind TEXT, p_source TEXT DEFAULT NULL) is an extension function and returns TEXT.
  • watches is a table installed or managed by the extension.

Requirements and Caveats

  • The reviewed control file declares default version 0.1.0.
  • The control file marks the extension as non-relocatable.
  • Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.

Table reader