Skip to main content

PgConstraint

Struct PgConstraint 

Source
pub struct PgConstraint {
Show 26 fields pub conname: Str, pub connamespace: Str, pub contype: PgConstraintContype, pub condeferrable: bool, pub condeferred: bool, pub convalidated: bool, pub conrelid: Option<Str>, pub contypid: Option<Str>, pub conindid: Option<Str>, pub conparentid: Option<Str>, pub confrelid: Option<Str>, 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<Str>>, pub conppeqop: Option<Vec<Str>>, pub conffeqop: Option<Vec<Str>>, pub confdelsetcols: Option<Vec<u16>>, pub conexclop: Option<Vec<Str>>, pub conbin: Option<Str>, pub description: Option<Str>,
}
Expand description

The DDL-only contents of pg_constraint

Fields§

§conname: Str

name Constraint name (not necessarily unique!)

§connamespace: Str

oid (references pg_namespace.oid) The OID of the namespace that contains this constraint

§contype: PgConstraintContype

char 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: bool

bool Is the constraint deferrable?

§condeferred: bool

bool Is the constraint deferred by default?

§convalidated: bool

bool Has the constraint been validated? Currently, can be false only for foreign keys and CHECK constraints

§conrelid: Option<Str>

oid (references pg_class.oid) The table this constraint is on; zero if not a table constraint

§contypid: Option<Str>

oid (references pg_type.oid) The domain this constraint is on; zero if not a domain constraint

§conindid: Option<Str>

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<Str>

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<Str>

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: bool

bool This constraint is defined locally for the relation. Note that a constraint can be locally defined and inherited simultaneously.

§coninhcount: u16

int2 The number of direct inheritance ancestors this constraint has. A constraint with a nonzero number of ancestors cannot be dropped nor renamed.

§connoinherit: bool

bool 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<Str>>

oid[] (references pg_operator.oid) If a foreign key, list of the equality operators for PK = FK comparisons

§conppeqop: Option<Vec<Str>>

oid[] (references pg_operator.oid) If a foreign key, list of the equality operators for PK = PK comparisons

§conffeqop: Option<Vec<Str>>

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<Str>>

oid[] (references pg_operator.oid) If an exclusion constraint, list of the per-column exclusion operators

§conbin: Option<Str>

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<Str>

text The comment from pg_description

Trait Implementations§

Source§

impl Clone for PgConstraint

Source§

fn clone(&self) -> PgConstraint

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PgConstraint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PgConstraint

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PgConstraint

Source§

fn eq(&self, other: &PgConstraint) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PgConstraint

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for PgConstraint

Source§

impl StructuralPartialEq for PgConstraint

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,