Skip to content

pgaudit_zig

Zig executor audit logging example for pgzx

pgzx · Zig executor audit logging example for pgzx

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102204pgaudit_zigpgzx0.1SECApache-2.0Zig

Usage

Sources:

pgaudit_zig 0.1 demonstrates executor audit hooks using pgzx. Upstream explicitly describes it as an incomplete teaching example and recommends pgaudit for production auditing.

Core Workflow

LOAD 'pg_audit_zig';
CREATE EXTENSION pgaudit_zig;
CREATE TABLE audit_demo (id integer);
SELECT * FROM audit_demo;

Operational Boundaries

The SQL extension is named pgaudit_zig, while the build names its library pg_audit_zig. Load that library explicitly in the session to install hooks; CREATE EXTENSION alone runs an otherwise empty SQL script and does not activate the logger. These operations require appropriate superuser privileges. The hooks log command kind, referenced relations and statement text. pgaudit_zig.log_statement is a superuser-settable boolean, defaulting to true, for including statement text; logged text can contain sensitive values. The reviewed code sends records through PostgreSQL logging. No complete audit coverage, tamper protection or compatibility range is promised by the example.

Table reader