↑↓ 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

range_minus_multi

Read the PG 20 devel manual

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

Reading PG 20devel·documented in 2 of 27 versions, 19 to 20

Development snapshot. These definitions may change before release.

Signatures & examples

range_minus_multi ( anyrange, anyrange ) → setof anyrange
Returns the non-empty range(s) remaining after subtracting the second range from the first. One row is returned for each range, so if the second range splits the first into two parts, there will be two results. If the subtraction yields an empty range, no rows are returned.
range_minus_multi('[0,10)'::int4range, '[3,4)'::int4range) → [0,3)
[4,10)
Version history 1
  1. 18 → 19 added

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