Skip to content

Event Trigger

Defines an Event Trigger

Properties

Property Type Required Description
sql string User-provided raw SQL snippet.
name string The event trigger name.
event ddl_command_start | ddl_command_end | table_rewrite | sql_drop The event that cause the fire to trigger.
filter object The name of a variable used to filter events. This makes it possible to restrict the firing of the trigger to a subset of the cases in which it is supported.
function string The trigger function to execute.
enabled ORIGIN | REPLICA | ALWAYS | DISABLED When the trigger fires (ALTER EVENT TRIGGER). ORIGIN, the default, fires it in a normal session; REPLICA only when session_replication_role is replica; ALWAYS in both; DISABLED never.
comment string An optional comment about the table.
dependencies dependencies Database objects this object is dependent upon.

filter

The name of a variable used to filter events. This makes it possible to restrict the firing of the trigger to a subset of the cases in which it is supported.

Property Type Required Description
tags array of string yes A list of tag values to filter on (e.g. 'DROP FUNCTION').

Mutually exclusive forms

Exactly one of these must hold:

  • sql, without name or event or filter or function
  • name and event and function, without sql

No other properties are accepted.


Source: schemata/event_trigger.yml · Resolved JSON Schema: event_trigger.json