pub struct Foreign {Show 16 fields
pub name: String,
pub referencing: bool,
pub action: Action,
pub query: String,
pub full: bool,
pub other: u32,
pub other_name: String,
pub columns: Vec<usize>,
pub names: Vec<String>,
pub other_columns: Vec<usize>,
pub types: Vec<u32>,
pub referencing_types: Vec<u32>,
pub constraint: u32,
pub deferrable: bool,
pub deferred: bool,
pub cloned: bool,
}Expand description
A foreign key that a write checks after the statement for each row that it wrote, as a trigger of ri_triggers.c checks it. The target table is the referencing table for RI_FKey_check_ins and RI_FKey_check_upd, and the referenced table for the triggers of the actions, such as RI_FKey_noaction_del and RI_FKey_cascade_upd.
Fields§
§name: StringThe name of the constraint.
referencing: boolTrue when the target table is the referencing table.
action: ActionThe action for an old key of the referenced table. It is Action::NoAction for the referencing table.
query: StringThe statement of CASCADE, SET NULL or SET DEFAULT on the referencing table, as ri_PlanCheck makes it, or an empty text. Its parameters are the old key, or for ON UPDATE CASCADE the new key and then the old key, with the types of Foreign::types.
full: boolMATCH FULL: a key with nulls and values is an error.
other: u32The OID of the other table.
other_name: StringThe name of the other table, for the error.
columns: Vec<usize>The key columns of the target table, from 0.
names: Vec<String>The names of the key columns of the target table, for the detail of the error.
other_columns: Vec<usize>The key columns of the other table, from 0.
types: Vec<u32>The type of each column of the key of the referenced table. The checks compare the values of the referencing table as values of these types.
referencing_types: Vec<u32>The type of each column of the key of the referencing table.
constraint: u32The OID of the constraint, which SET CONSTRAINTS names.
deferrable: booltgdeferrable: SET CONSTRAINTS can defer the trigger. The trigger of an action is not deferrable.
deferred: booltginitdeferred: the trigger fires at the commit when SET CONSTRAINTS does not change its mode.
cloned: booltgisclone: the trigger is a clone of a trigger of the parent table. The delete of a row that an UPDATE moves to another partition skips such a trigger of the referenced table, because the event of the update of the partitioned table does its work.