pub enum BinOp {
Show 55 variants
Or,
And,
Eq,
NotEq,
IsDistinctFrom,
IsNotDistinctFrom,
IntDiv,
Lt,
LtEq,
Gt,
GtEq,
Add,
Sub,
Mul,
Div,
Mod,
L2Distance,
GeomParallel,
OverLeft,
OverRight,
GeomPerp,
GeomSameAs,
ClosestPoint,
GeomHoriz,
InnerProduct,
CosineDistance,
Concat,
BitOr,
BitAnd,
BitXor,
LogicalXor,
JsonGet,
JsonGetText,
JsonGetPath,
JsonGetPathText,
JsonContains,
JsonPathExists,
JsonContainedBy,
JsonKeyExists,
JsonKeysAny,
JsonKeysAll,
JsonDeletePath,
TsMatch,
InetContainedBy,
InetContainedByEq,
InetContains,
InetContainsEq,
InetOverlap,
Intersects,
IsBelow,
IsAbove,
PatternLt,
PatternLtEq,
PatternGt,
PatternGtEq,
}Variants§
Or
And
Eq
NotEq
IsDistinctFrom
v7.9.27b — PG a IS DISTINCT FROM b / a IS NOT DISTINCT FROM b. NULL-safe equality: NULL IS NOT DISTINCT FROM
NULL → true, NULL IS DISTINCT FROM NULL → false. The
non-NULL behaviour matches <> / = exactly. Common in
PG-style JOIN ON predicates and pg_dump output.
IsNotDistinctFrom
IntDiv
v7.39 (round 353, M9) — MySQL’s DIV: integer division that
truncates TOWARD ZERO (-7 DIV 2 is -3, measured on MariaDB 11)
and answers NULL on a zero divisor. MySQL-dialect only; / there
is a real division (round 351).
Lt
LtEq
Gt
GtEq
Add
Sub
Mul
Div
Mod
v7.37.7 C.1.7 — PG / SQL standard integer modulo. Same precedence as Mul/Div; result type follows left operand.
L2Distance
pgvector L2 (Euclidean) distance <->. Defined for two vector
operands of equal dimension; engine returns Value::Float(d).
GeomParallel
v7.39 (read01 geo_ops.c) — ?|| geometric “is parallel”.
OverLeft
v7.39 (read01 rangetypes.c) — range &< / &>.
OverRight
GeomPerp
v7.39 (read01 geo_ops.c) — ?-| geometric “is perpendicular”.
GeomSameAs
v7.39 (read01 geo_ops.c) — ~= geometric “same as”.
ClosestPoint
v7.39 (read01 geo_ops.c) — ## closest point on the right-hand
object to the left-hand one.
GeomHoriz
v7.39 (read01 geo_ops.c) — ?- points horizontally aligned.
InnerProduct
pgvector inner-product <#> — returns -Σ aᵢ bᵢ so “smaller =
more similar” remains true (matches pgvector’s published convention).
CosineDistance
pgvector cosine distance <=> — 1 - (a·b)/(|a| |b|).
Concat
SQL string concatenation ||. NULL propagates.
BitOr
Bitwise OR | on integers.
BitAnd
Bitwise AND & on integers.
BitXor
Bitwise XOR # on integers and equal-length bit strings.
LogicalXor
v7.39 (round 407) — MySQL’s logical XOR operator. Reads both
sides as truth values and returns their exclusive-or (1 XOR 0
is 1, 1 XOR 1 is 0); NULL on either side yields NULL. Only the
MySQL dialect produces it; PG has no logical XOR. Its precedence
sits between OR (loosest) and AND.
JsonGet
v4.14 json -> key — element access by string key (object)
or integer index (array). Returns a JSON value.
JsonGetText
v4.14 json ->> key — same access, returns the result as
TEXT (unwraps a top-level JSON string; renders other scalars
as their canonical text).
JsonGetPath
v6.4.5 json #> path_text — walk the path encoded as a PG
text array literal like '{a,0,b}'. Returns JSON.
JsonGetPathText
v6.4.5 json #>> path_text — same walk, returns TEXT.
JsonContains
v6.4.5 json @> sub_json — containment. Returns BOOL; true
when every key/value in sub_json is structurally present in
the left side. Matches PG semantics (top-level + recursive).
JsonPathExists
@? — jsonb path existence (jsonb_path_exists).
JsonContainedBy
v7.37.6-A json <@ sub_json — contained-by. Returns BOOL;
a <@ b is defined as b @> a (same semantics, swapped
sides). Eval dispatch reuses JsonContains with swapped args.
JsonKeyExists
v7.37.6-A json ? key — key-exists. RHS is TEXT;
returns BOOL. For an object, true if key is an existing
member name; for an array, true if any element is the string
key (PG semantics).
JsonKeysAny
v7.37.6-A json ?| keys — any-key-exists. RHS is TEXT[];
returns BOOL.
JsonKeysAll
v7.37.6-A json ?& keys — all-keys-exist. RHS is TEXT[];
returns BOOL.
JsonDeletePath
jsonb #- path_text[] — delete the value at a nested path.
RHS is a PG text-array literal like '{a,b}'; returns JSONB.
TsMatch
v7.12.2 tsvector @@ tsquery — FTS match. Returns BOOL;
3VL on NULL. Symmetric: PG also accepts tsquery @@ tsvector and engine eval normalises either ordering.
InetContainedBy
v7.17.0 Phase 3.P0-47 — PG INET / CIDR strict contained-in
<<. LHS network is strictly inside RHS network (no equality).
InetContainedByEq
v7.17.0 Phase 3.P0-47 — PG INET / CIDR contained-in-or-equal
<<=. LHS network ⊆ RHS network.
InetContains
v7.17.0 Phase 3.P0-47 — PG INET / CIDR strict contains >>.
LHS network strictly contains RHS network.
InetContainsEq
v7.17.0 Phase 3.P0-47 — PG INET / CIDR contains-or-equal >>=.
LHS network ⊇ RHS network.
InetOverlap
v7.17.0 Phase 3.P0-47 — PG INET / CIDR network overlap &&.
True iff either network contains any address of the other.
Intersects
v7.39 (round 508) — ?#, “do these intersect”: box/box, line/box,
line/line, lseg/box, lseg/line, lseg/lseg, path/path.
IsBelow
v7.39 (round 508) — <^ / >^, strictly below / strictly above
(point, box).
IsAbove
PatternLt
v7.39 (round 508) — the text_pattern_ops comparisons ~<~, ~<=~,
~>~, ~>=~: BYTE order, ignoring collation. 'A' ~<~ 'a' is true
where 'A' < 'a' is false under a non-C collation, which is the
whole reason the operator family exists — it is what makes a LIKE
prefix index-usable. pg_dump writes these into index definitions.