Parameter · Client Connection Defaults / Statement Behavior
event_triggers
Enables event triggers. When enabled, event triggers will fire for all applicable statements.
- Default:
on - Type: bool
- Applies: Session (superuser)
In plain words
Event triggers run code when DDL happens (CREATE, ALTER, DROP…) or, since PostgreSQL 17, at login. A buggy one can block all DDL or even all logins. This switch, added in PostgreSQL 17, lets a superuser turn them all off temporarily to fix the problem.
For DBAs and operators
When off, no event triggers fire in that session: ddl_command_start, ddl_command_end, sql_drop, table_rewrite and login. Only superusers (or roles granted SET) can change it.
Recovery recipe for a broken login event trigger that prevents connections:
PGOPTIONS='-c event_triggers=off' psql -U postgres
ALTER EVENT TRIGGER bad_login DISABLE; -- or DROP
Before PostgreSQL 17 the only escape was starting the server in single-user mode, where event triggers are not fired. Extensions that rely on event triggers (DDL auditing, logical DDL replication tools such as pgl_ddl_deploy) are also bypassed while it is off, so keep its use short and controlled.
How to change it
A superuser (or a role granted SET) can change it per session with SET.