[][src]Enum postgres_parser::sys::ConstrType

#[repr(u32)]pub enum ConstrType {
    CONSTR_NULL,
    CONSTR_NOTNULL,
    CONSTR_DEFAULT,
    CONSTR_IDENTITY,
    CONSTR_GENERATED,
    CONSTR_CHECK,
    CONSTR_PRIMARY,
    CONSTR_UNIQUE,
    CONSTR_EXCLUSION,
    CONSTR_FOREIGN,
    CONSTR_ATTR_DEFERRABLE,
    CONSTR_ATTR_NOT_DEFERRABLE,
    CONSTR_ATTR_DEFERRED,
    CONSTR_ATTR_IMMEDIATE,
}

Definitions for constraints in CreateStmt

Note that column defaults are treated as a type of constraint, even though that's a bit odd semantically.

For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT) we may have the expression in either "raw" form (an untransformed parse tree) or "cooked" form (the nodeToString representation of an executable expression tree), depending on how this Constraint node was created (by parsing, or by inheritance from an existing relation). We should never have both in the same node!

FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are stored into pg_constraint.confmatchtype. Changing the code values may require an initdb!

If skip_validation is true then we skip checking that the existing rows in the table satisfy the constraint, and just install the catalog entries for the constraint. A new FK constraint is marked as valid iff initially_valid is true. (Usually skip_validation and initially_valid are inverses, but we can set both true if the table is known empty.)

Constraint attributes (DEFERRABLE etc) are initially represented as separate Constraint nodes for simplicity of parsing. parse_utilcmd.c makes a pass through the constraints list to insert the info into the appropriate Constraint node.

Variants

CONSTR_NULL
CONSTR_NOTNULL

not standard SQL, but a lot of people expect it

CONSTR_DEFAULT

not standard SQL, but a lot of people expect it

CONSTR_IDENTITY

not standard SQL, but a lot of people expect it

CONSTR_GENERATED

not standard SQL, but a lot of people expect it

CONSTR_CHECK

not standard SQL, but a lot of people expect it

CONSTR_PRIMARY

not standard SQL, but a lot of people expect it

CONSTR_UNIQUE

not standard SQL, but a lot of people expect it

CONSTR_EXCLUSION

not standard SQL, but a lot of people expect it

CONSTR_FOREIGN

not standard SQL, but a lot of people expect it

CONSTR_ATTR_DEFERRABLE

not standard SQL, but a lot of people expect it

CONSTR_ATTR_NOT_DEFERRABLE

attributes for previous constraint node

CONSTR_ATTR_DEFERRED

attributes for previous constraint node

CONSTR_ATTR_IMMEDIATE

attributes for previous constraint node

Trait Implementations

impl Clone for ConstrType[src]

impl Copy for ConstrType[src]

impl Debug for ConstrType[src]

impl<'de> Deserialize<'de> for ConstrType[src]

impl Eq for ConstrType[src]

impl Hash for ConstrType[src]

impl PartialEq<ConstrType> for ConstrType[src]

impl Serialize for ConstrType[src]

impl StructuralEq for ConstrType[src]

impl StructuralPartialEq for ConstrType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.