pub struct Constraint {Show 18 fields
pub oid: u32,
pub name: String,
pub namespace: u32,
pub kind: ConKind,
pub relation: u32,
pub domain: u32,
pub keys: Vec<i16>,
pub index: u32,
pub deferrable: bool,
pub deferred: bool,
pub validated: bool,
pub enforced: bool,
pub no_inherit: bool,
pub local: bool,
pub inhcount: i16,
pub parent: u32,
pub expr: Option<String>,
pub foreign: Option<ForeignKey>,
}Expand description
A constraint, one row of pg_constraint.
Fields§
§oid: u32The OID.
name: StringThe name.
namespace: u32The OID of the schema.
kind: ConKindThe kind.
relation: u32The OID of the relation, or 0 for a constraint of a domain.
domain: u32contypid: the OID of the domain of a domain constraint, else 0.
keys: Vec<i16>The constrained columns, conkey.
index: u32The OID of the index of a primary key, a unique constraint or a foreign key, else 0.
deferrable: boolcondeferrable.
deferred: boolcondeferred.
validated: boolconvalidated.
enforced: boolconenforced: false for a check constraint or a foreign key that is NOT ENFORCED. Writes do not check such a constraint.
no_inherit: boolconnoinherit.
local: boolconislocal: false for a constraint that only a parent table gives.
inhcount: i16coninhcount: the number of parent tables that give the constraint.
parent: u32conparentid: the constraint of the parent table that a constraint of a partition comes from, or 0.
expr: Option<String>The expression of a check constraint, in the form of the analyzer.
foreign: Option<ForeignKey>The facts of a foreign key.