Skip to content

event_triggers

event_triggers is the PostgreSQL setting that controls whether PostgreSQL enables event triggers.
Note

Fact — official short description: “Enables event triggers.”

Identity

Type , Valuebool
Upstream pg_settings type
Context , Valuesuperuser
Settable at runtime by a superuser
Unit , Value
Raw unit
Range , Value
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueClient Connection Defaults / Statement Behavior
Upstream classification
Latest boot value , Valueon
on

Lifecycle

Fact Value
First observed PG17
Present in PG17–19 Beta 3
Removed in No
Introduction commit 7750fefdb2b8 — Add GUC for temporarily disabling event triggers
Commit date 2023-09-25
Discussion thread 1 · thread 2

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG17–19 Beta 3 on on

How it works

event_triggers enables event triggers. When enabled, event triggers will fire for all applicable statements. The switch disables all event triggers as an emergency repair aid; it is not a selective trigger policy and requires elevated SET privilege.

event_triggers is a SUPERUSER-context setting. Superuser or a role granted the appropriate SET privilege can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.

Because session state can survive in pooled connections, role defaults, SET privilege, RESET behavior, and application checkout hooks are part of the control’s effective boundary.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Do not tune event_triggers or leave it off as normal operation. Disable it only in a controlled repair session, identify the faulty trigger, and restore it immediately.
OLAP Keep event triggers enabled unless a documented bulk-load procedure has reviewed every lost audit or DDL side effect.
Small nodes Leave the default on; disabling event triggers saves no meaningful resources and can silently bypass controls.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP Unmodified
OLAP Unmodified
CRIT Unmodified
TINY Unmodified
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG17–19 Beta 3 unmodified; OLAP: PG17–19 Beta 3 unmodified; CRIT: PG17–19 Beta 3 unmodified; TINY: PG17–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

Common pitfalls

  • Changing event_triggers in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.
  • Granting broad SET rights to a control that can change correctness, policy enforcement, or name resolution.
  • Failing to reset a security-sensitive session value before a pooled connection is reused by another request.
  • Changing event_triggers globally without a rollback plan and a client or operational compatibility test.

search_path · row_security · session_replication_role · restrict_nonsystem_relation_kind · createrole_self_grant

References