pub struct TriggerDef {
pub name: String,
pub table: String,
pub timing: String,
pub events: Vec<String>,
pub for_each: String,
pub function: String,
pub update_columns: Vec<String>,
pub enabled: bool,
pub when_condition: String,
}Expand description
v7.12.4 — catalogued trigger. References its function by name; the function must exist at TRIGGER creation time (forward references are deferred to v7.12.5+).
Fields§
§name: String§table: StringWatched table. Trigger is dropped when the table drops.
timing: String"BEFORE" / "AFTER" / "INSTEAD OF". Stored as the
uppercased keyword so deserialised catalogs round-trip
without canonicalisation surprises.
events: Vec<String>Each entry is one of "INSERT" / "UPDATE" / "DELETE"
/ "TRUNCATE". INSERT OR UPDATE parses to two entries.
for_each: String"ROW" / "STATEMENT". v7.12.4 ships "ROW" only;
"STATEMENT" parses and persists but the executor
refuses it at trigger fire time.
function: StringName of the PL/pgSQL function to invoke.
update_columns: Vec<String>v7.13.0 — UPDATE OF col, col, … column-list filter
(mailrs round-5 G7). Non-empty means the trigger fires
only when at least one of these columns appears in the
UPDATE’s SET list. Empty = no column filter. Stored in
catalog FILE_VERSION 23+; older catalogs deserialise with
an empty vec.
enabled: boolv7.16.1 — whether the trigger fires when its watched
event occurs. Toggled by ALTER TABLE … { ENABLE | DISABLE } TRIGGER …; pg_dump –disable-triggers wraps
every data block with a DISABLE/ENABLE pair so the
rows already-computed in prod don’t get re-rewritten.
Defaults to true at CREATE TRIGGER time. Stored in
catalog FILE_VERSION 25+; older catalogs deserialise
with enabled = true.
when_condition: Stringv7.39 (round 138) — the deparsed WHEN ( condition ) predicate text
(re-parsed at fire time to filter row triggers). Empty = no WHEN.
Persisted from FILE_VERSION 70; older catalogs read back empty.
Trait Implementations§
Source§impl Clone for TriggerDef
impl Clone for TriggerDef
Source§fn clone(&self) -> TriggerDef
fn clone(&self) -> TriggerDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more