pub struct OnConflictClause {
pub target_columns: Vec<String>,
pub index_where: Option<Expr>,
pub constraint_name: Option<String>,
pub mysql_lowered: bool,
pub action: OnConflictAction,
}Expand description
v7.9.7 — INSERT upsert clause: ON CONFLICT (target) DO action.
Fields§
§target_columns: Vec<String>Local columns that identify the conflict (must match a
UNIQUE / PRIMARY KEY index on the target table). Empty
list means the user wrote ON CONFLICT DO … without a
target — the engine arbitrates on every unique constraint
(round 240).
index_where: Option<Expr>v7.39 (round 240) — the index predicate after the target list
(ON CONFLICT (col) WHERE pred DO …). PG uses it to infer a
PARTIAL unique index; SPG’s conflict arbiters are full indexes,
which satisfy any predicate, so it is parsed and carried but not
consulted (recorded residual: partial-unique-index arbiters).
constraint_name: Option<String>v7.37.17 (17.6 siblings) — ON CONFLICT ON CONSTRAINT <name>: the pg_dump conflict-target form. The engine
resolves the name to the constraint’s columns.
mysql_lowered: boolv7.39 (round 240) — true when this clause was LOWERED from MySQL’s
ON DUPLICATE KEY UPDATE / REPLACE INTO, whose bare-target DO
UPDATE is legal (MySQL watches every unique key); PG’s own bare
ON CONFLICT DO UPDATE is refused (42601).
action: OnConflictActionThe action on conflict.
Trait Implementations§
Source§impl Clone for OnConflictClause
impl Clone for OnConflictClause
Source§fn clone(&self) -> OnConflictClause
fn clone(&self) -> OnConflictClause
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OnConflictClause
impl Debug for OnConflictClause
Source§impl Display for OnConflictClause
v7.30.1 (mailrs round-24) — render the ON CONFLICT clause the
parser produced, so the AST→SQL round trip preserves upsert
semantics (WAL replay depends on it).
impl Display for OnConflictClause
v7.30.1 (mailrs round-24) — render the ON CONFLICT clause the parser produced, so the AST→SQL round trip preserves upsert semantics (WAL replay depends on it).