schema_triggers
pg_schema_triggers · Archived C hook extension adding relation, column, and trigger schema-change events to PostgreSQL event triggers.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100142 | schema_triggers | pg_schema_triggers | 0.1 | FEAT | BSD-2-Clause | C |
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
Usage
Sources:
schema_triggers version 0.1 extends PostgreSQL’s event-trigger machinery with events for relation, column, and trigger changes. The project is archived, was last updated in 2015, and hooks PostgreSQL internals; use it only with an explicitly validated legacy server build.
Enablement
The extension must both install its database objects and load its hook library. Add the library to configuration and restart PostgreSQL, then install it in each database that needs the helper types and functions:
For isolated testing only, the upstream README permits LOAD 'schema_triggers.so' in one session instead of server preload.
Core Workflow
Events and Helpers
The new events are relation_create, relation_alter, relation_drop, column_add, column_alter, column_drop, trigger_create, and trigger_drop. Each event has a matching get_*_eventinfo() function returning a composite record with relevant catalog rows and identifiers.
Safety and Compatibility
The control file requires superuser installation. Trigger functions run synchronously during DDL and can reject or disrupt schema changes; keep them small and failure-aware. Event-info records expose version-sensitive pg_class, pg_attribute, and pg_trigger row layouts. Because the repository is explicitly unmaintained and predates modern PostgreSQL releases, do not assume binary or catalog compatibility from the historical “PostgreSQL 9.3 and higher” statement.