Skip to content

pgpm-stamps

Timestamp and actor audit triggers for PGPM applications.

pgpm-stamps · Timestamp and actor audit triggers for PGPM applications.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102161pgpm-stampspgpm-stamps0.47.0FUNCMITPLpgSQL
Relationships
Requiresplpgsql pgpm-jwt-claims pgpm-verify

Usage

Sources:

pgpm-stamps supplies stamps.timestamps() and stamps.peoplestamps() triggers. The first maintains creation/update timestamps; the second uses jwt_public.current_user_id() to maintain creation/update actor UUIDs.

Core Workflow

CREATE EXTENSION "pgpm-stamps";
CREATE TABLE stamp_demo (
  id integer PRIMARY KEY,
  body text,
  created_at timestamptz,
  updated_at timestamptz
);
CREATE TRIGGER stamp_demo_timestamps
BEFORE INSERT OR UPDATE ON stamp_demo
FOR EACH ROW EXECUTE FUNCTION stamps.timestamps();

Operational Boundaries

Attach the triggers before INSERT or UPDATE. Timestamp tracking needs created_at and updated_at columns; actor tracking needs created_by and updated_by. On update, the creation fields are preserved and update fields are replaced. JWT identity is supplied by the application. These triggers record row metadata, not a separate immutable history. Dependencies are plpgsql, pgpm-jwt-claims, pgpm-verify. The installation SQL grants privileges to the pre-existing roles authenticated, anonymous. This SQL-only module needs no library preload or restart; no PostgreSQL-major support matrix is published for this revision. Its fixed schema layout is not relocatable. Install the matching dependency closure before enabling it.

Table reader