3.16. Event triggers
Event triggers work like ordinary triggers in the way they are fired: when a specific event occurs. But their similarity ends here. Instead of being activated when an event occurs on a table, the event triggers are fired whenever an event happens on the database level. In other words, event triggers are fired when a DDL command or other database-level command is issued on the server. One practical usage for event triggers is when the system administrator needs to audit commands executed on the database server or even deny certain DDL commands to be performed on it. Details about event triggers are displayed below.
123
| Attributes | ||
|---|---|---|
| # | Field | Description |
| 1 | Event | Defines the event that fires the trigger. Four events are valid: The The The The |
| 2 | Function | The function executed by the trigger when it is activated. The function must return |
| 3 | Filtered tag commands | The commands (tags) that fire the trigger, used to filter it. The complete list of commands can be found in the PostgreSQL documentation. More than one tag can be specified. |
References
Event trigger DDL
https://www.postgresql.org/docs/current/static/sql-createeventtrigger.html
Event trigger matrix
https://www.postgresql.org/docs/current/static/event-trigger-matrix.html