pub enum TriggerError {
UnparseableBody {
function: String,
detail: String,
},
UnsupportedConstruct {
function: String,
detail: String,
},
OldIsReadOnly {
function: String,
column: String,
},
NewReadOnlyInAfterTrigger {
function: String,
column: String,
},
UnknownColumn {
function: String,
column: String,
table: String,
},
EvalFailed {
function: String,
cause: EvalError,
},
RaiseException {
function: String,
message: String,
},
}Expand description
Result type the trigger executor exposes. Wraps EvalError
at the eval-of-expressions layer and adds trigger-specific
failure modes (OLD.col := …, unsupported PL/pgSQL feature,
body that fails to re-parse, …).
Variants§
UnparseableBody
Body source stored in the catalog can’t be re-parsed. Usually means the function was created against a newer PL/pgSQL surface than the running engine knows about.
UnsupportedConstruct
Trigger function uses a v7.12.5+ language feature (DECLARE, IF, embedded SQL, RAISE, …). The error names the construct so the operator can plan around it until the feature lands.
OldIsReadOnly
OLD.col := <expr> inside the body. PG itself rejects
this; we surface a clear message rather than silently
dropping the assignment.
NewReadOnlyInAfterTrigger
NEW.col := <expr> in an AFTER trigger — same rationale
as OLD: PG enforces “NEW is read-only after the row has
been written” and we mirror.
UnknownColumn
NEW.col := <expr> against a non-existent column.
Usually a schema-drift bug.
EvalFailed
Sub-expression eval inside the trigger body failed. The
wrapped EvalError explains the underlying cause
(ColumnNotFound, TypeMismatch, …).
RaiseException
v7.12.6 — RAISE EXCEPTION '<message>' [, args]* in the
trigger body. The interpreter formats the args into the
message via PG-style % substitution and surfaces the
resolved text up to the caller.
Trait Implementations§
Source§impl Clone for TriggerError
impl Clone for TriggerError
Source§fn clone(&self) -> TriggerError
fn clone(&self) -> TriggerError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TriggerError
impl Debug for TriggerError
Source§impl Display for TriggerError
impl Display for TriggerError
Source§impl PartialEq for TriggerError
impl PartialEq for TriggerError
Source§fn eq(&self, other: &TriggerError) -> bool
fn eq(&self, other: &TriggerError) -> bool
self and other values to be equal, and is used by ==.