You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Range-receiver overloads with a RangeSet operand, and RangeSet.IsContainedBy (the other half of the range × multirange operator matrix) #92
PostgreSQL's range × multirange operator matrix has two halves. The multirange-receiver half is complete on RangeSet (set.Contains(range), set.Overlaps(range), set.IsAdjacentTo(range), <<, >>, &<, &>). The range-receiver half has no member: a range cannot take a RangeSet operand, and RangeSet has no IsContainedBy at all.
Enumerated from pg_operator on 17.11 and 18.4 (identical): anyrange @> anymultirange, anyrange <@ anymultirange, anyrange && anymultirange, anyrange << anymultirange, anyrange >> anymultirange, anyrange &< anymultirange, anyrange &> anymultirange, anyrange -|- anymultirange, and anymultirange <@ anyrange, anymultirange <@ anymultirange.
Most are reachable through symmetry or a converse today (&&, -|- are symmetric; a << m is m.IsStrictlyRightOf(a); a <@ m is m.Contains(a)). Three are not:
anyrange @> anymultirange — range.Contains(set); equally set.IsContainedBy(range), which is missing in both forms (RangeSet.IsContainedBy(IRange<T>), RangeSet.IsContainedBy(RangeSet)).
anyrange &< anymultirange and anyrange &> anymultirange — not converses of the set-receiver forms (a &< m is upper(a) <= upper(m); m &> a is lower(m) >= lower(a)).
Proposed API: on the IRange<T> extension block, overloads taking RangeSet<TRange, T> for Contains, IsContainedBy, Overlaps, IsStrictlyLeftOf, IsStrictlyRightOf, DoesNotExtendRightOf, DoesNotExtendLeftOf, IsAdjacentTo; on RangeSet, IsContainedBy(IRange<T>) and IsContainedBy(RangeSet).
Translation: the operator with the range on the left, as PostgreSQL has it (b."Period" @> b."Blocked", b."Period" &< b."Blocked"), no multirange lift needed on the range side.
Done when: every one of the 10 operators above has a member, ShapeMatrixParityTests (or a sibling) asks PostgreSQL for every ordered (range shape, set) pair, and docs/ranges.md no longer says "the full multirange operator matrix" only from the set side.
Found by the PostgreSQL catalogue sweep (pg_operator over anyrange/anymultirange), 2026-10-17.
Activity