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.
owner string — The role that owns the event trigger. It must be a superuser. When it is absent, deploy does not set or compare the owner.
event ddl_command_start | ddl_command_end | table_rewrite | sql_drop | login — 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.
security_labels security_labels — Security Labels.
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