pub struct PgConstraint {Show 26 fields
pub conname: SmolStr,
pub connamespace: SmolStr,
pub contype: PgConstraintContype,
pub condeferrable: bool,
pub condeferred: bool,
pub convalidated: bool,
pub conrelid: Option<SmolStr>,
pub contypid: Option<SmolStr>,
pub conindid: Option<SmolStr>,
pub conparentid: Option<SmolStr>,
pub confrelid: Option<SmolStr>,
pub confupdtype: Option<PgConstraintConfupdtype>,
pub confdeltype: Option<PgConstraintConfdeltype>,
pub confmatchtype: Option<PgConstraintConfmatchtype>,
pub conislocal: bool,
pub coninhcount: u16,
pub connoinherit: bool,
pub conkey: Option<Vec<u16>>,
pub confkey: Option<Vec<u16>>,
pub conpfeqop: Option<Vec<SmolStr>>,
pub conppeqop: Option<Vec<SmolStr>>,
pub conffeqop: Option<Vec<SmolStr>>,
pub confdelsetcols: Option<Vec<u16>>,
pub conexclop: Option<Vec<SmolStr>>,
pub conbin: Option<SmolStr>,
pub description: Option<SmolStr>,
}Expand description
The DDL-only contents of pg_constraint
Fields§
§conname: SmolStrname Constraint name (not necessarily unique!)
connamespace: SmolStroid (references pg_namespace.oid) The OID of the namespace that contains this constraint
contype: PgConstraintContypechar c = check constraint, f = foreign key constraint, n = not-null constraint (domains only), p = primary key constraint, u = unique constraint, t = constraint trigger, x = exclusion constraint
condeferrable: boolbool Is the constraint deferrable?
condeferred: boolbool Is the constraint deferred by default?
convalidated: boolbool Has the constraint been validated? Currently, can be false only for foreign keys and CHECK constraints
conrelid: Option<SmolStr>oid (references pg_class.oid) The table this constraint is on; zero if not a table constraint
contypid: Option<SmolStr>oid (references pg_type.oid) The domain this constraint is on; zero if not a domain constraint
conindid: Option<SmolStr>oid (references pg_class.oid) The index supporting this constraint, if it’s a unique, primary key, foreign key, or exclusion constraint; else zero
conparentid: Option<SmolStr>oid (references pg_constraint.oid) The corresponding constraint of the parent partitioned table, if this is a constraint on a partition; else zero
confrelid: Option<SmolStr>oid (references pg_class.oid) If a foreign key, the referenced table; else zero
confupdtype: Option<PgConstraintConfupdtype>char Foreign key update action code: a = no action, r = restrict, c = cascade, n = set null, d = set default
confdeltype: Option<PgConstraintConfdeltype>char Foreign key deletion action code: a = no action, r = restrict, c = cascade, n = set null, d = set default
confmatchtype: Option<PgConstraintConfmatchtype>char Foreign key match type: f = full, p = partial, s = simple
conislocal: boolbool This constraint is defined locally for the relation. Note that a constraint can be locally defined and inherited simultaneously.
coninhcount: u16int2 The number of direct inheritance ancestors this constraint has. A constraint with a nonzero number of ancestors cannot be dropped nor renamed.
connoinherit: boolbool This constraint is defined locally for the relation. It is a non-inheritable constraint.
conkey: Option<Vec<u16>>int2[] (references pg_attribute.attnum) If a table constraint (including foreign keys, but not constraint triggers), list of the constrained columns
confkey: Option<Vec<u16>>int2[] (references pg_attribute.attnum) If a foreign key, list of the referenced columns
conpfeqop: Option<Vec<SmolStr>>oid[] (references pg_operator.oid) If a foreign key, list of the equality operators for PK = FK comparisons
conppeqop: Option<Vec<SmolStr>>oid[] (references pg_operator.oid) If a foreign key, list of the equality operators for PK = PK comparisons
conffeqop: Option<Vec<SmolStr>>oid[] (references pg_operator.oid) If a foreign key, list of the equality operators for FK = FK comparisons
confdelsetcols: Option<Vec<u16>>int2[] (references pg_attribute.attnum) If a foreign key with a SET NULL or SET DEFAULT delete action, the columns that will be updated. If null, all of the referencing columns will be updated.
conexclop: Option<Vec<SmolStr>>oid[] (references pg_operator.oid) If an exclusion constraint, list of the per-column exclusion operators
conbin: Option<SmolStr>pg_node_tree If a check constraint, an internal representation of the expression. (It’s recommended to use pg_get_constraintdef() to extract the definition of a check constraint.)
description: Option<SmolStr>text The comment from pg_description
Trait Implementations§
Source§impl Clone for PgConstraint
impl Clone for PgConstraint
Source§fn clone(&self) -> PgConstraint
fn clone(&self) -> PgConstraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PgConstraint
impl Debug for PgConstraint
Source§impl<'de> Deserialize<'de> for PgConstraint
impl<'de> Deserialize<'de> for PgConstraint
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PgConstraint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PgConstraint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PgConstraint
impl PartialEq for PgConstraint
Source§impl Serialize for PgConstraint
impl Serialize for PgConstraint
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for PgConstraint
impl StructuralPartialEq for PgConstraint
Auto Trait Implementations§
impl Freeze for PgConstraint
impl RefUnwindSafe for PgConstraint
impl Send for PgConstraint
impl Sync for PgConstraint
impl Unpin for PgConstraint
impl UnsafeUnpin for PgConstraint
impl UnwindSafe for PgConstraint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.