select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / RANGE/MULTIRANGE FUNCTIONS AND OPERATORS

multirange_minus_multi

Read PG 20 devel manual ↗

Returns the non-empty multirange(s) remaining after subtracting the second multirange from the first.

Development snapshot. These definitions may change before release.

Signatures & examples

multirange_minus_multi ( anymultirange, anymultirange ) → setof anymultirange
Returns the non-empty multirange(s) remaining after subtracting the second multirange from the first. If the subtraction yields an empty multirange, no rows are returned. Two rows are never returned, because a single multirange can always accommodate any result.
multirange_minus_multi('{[0,10)}'::int4multirange, '{[3,4)}'::int4multirange) → {[0,3), [4,10)}
Version history 1
  1. PG 18 → 19added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source