See Section 8.17 for an overview of range types.
Table 9.58 shows the specialized operators available for range types. Table 9.59 shows the specialized operators available for multirange types. In addition to those, the usual comparison operators shown in Table 9.1 are available for range and multirange types. The comparison operators order first by the range lower bounds, and only if those are equal do they compare the upper bounds. The multirange operators compare each range until one is unequal. This does not usually result in a useful overall ordering, but the operators are provided to allow unique indexes to be constructed on ranges.
Table 9.58. Range Operators
|
Operator Description Example(s) |
|---|
|
Does the first range contain the second?
|
|
Does the range contain the element?
|
|
Is the first range contained by the second?
|
|
Is the element contained in the range?
|
|
Do the ranges overlap, that is, have any elements in common?
|
|
Is the first range strictly left of the second?
|
|
Is the first range strictly right of the second?
|
|
Does the first range not extend to the right of the second?
|
|
Does the first range not extend to the left of the second?
|
|
Are the ranges adjacent?
|
|
Computes the union of the ranges. The ranges must overlap or be adjacent, so that the union is a single range (but see
|
|
Computes the intersection of the ranges.
|
|
Computes the difference of the ranges. The second range must not be contained in the first in such a way that the difference would not be a single range.
|
Table 9.59. Multirange Operators
|
Operator Description Example(s) |
|---|
|
Does the first multirange contain the second?
|
|
Does the multirange contain the range?
|
|
Does the multirange contain the element?
|
|
Does the range contain the multirange?
|
|
Is the first multirange contained by the second?
|
|
Is the multirange contained by the range?
|
|
Is the range contained by the multirange?
|
|
Is the element contained by the multirange?
|
|
Do the multiranges overlap, that is, have any elements in common?
|