pub struct ExclusionConstraint {
pub name: String,
pub method: Option<String>,
pub elements: Vec<(usize, String)>,
}Expand description
v7.39 (round 210) — an EXCLUDE constraint. Forbids two distinct live
rows from satisfying, for EVERY element, new.col <op> existing.col
(e.g. EXCLUDE USING gist (during WITH &&) = no two during ranges
overlap). Unlike a uniqueness constraint the operator is not equality,
so enforcement is a full live-row scan re-checking the operator (a real
GiST index that answers overlap in O(log n) is a later perf phase). A
NULL in any element column exempts the row (matching PG / UNIQUE NULL
semantics). Persisted in catalog FILE_VERSION 72+.
Fields§
§name: StringThe constraint’s SQL name. PG auto-names an unnamed EXCLUDE
<table>_<leading-col>_excl; the engine synthesises that at CREATE
TABLE time so this is always populated.
method: Option<String>Access method spelled after USING (gist, spgist, …), lower-cased.
None = no USING clause. Purely cosmetic for enforcement; it round-
trips into pg_get_constraintdef.
elements: Vec<(usize, String)>One (column-position, operator-spelling) pair per element, in
declaration order. The operator spelling is the wire token (&&,
=, @>, <@, &<, &>) evaluated against each existing row.
Trait Implementations§
Source§impl Clone for ExclusionConstraint
impl Clone for ExclusionConstraint
Source§fn clone(&self) -> ExclusionConstraint
fn clone(&self) -> ExclusionConstraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more