All Products
Search
Document Center

PolarDB:ST_isSorted

Last Updated:Aug 21, 2026

Checks whether all pcpoint objects in a pcpatch object are sorted based on the specified attribute dimensions.

Syntax

boolean ST_isSorted(pcpatch pc, text[] dimnames, boolean strict default true);

Parameters

ParameterDescription
pcThe pcpatch object to check.
dimnamesThe attribute dimensions to sort by, specified as an array of dimension names.
strictWhen true (default), requires strict ordering: no two pcpoint objects can have identical values for the specified attribute dimensions. When false, allows duplicate values.

Examples

Check whether a patch is sorted along dimensions a and c:

SELECT ST_isSorted(pa, Array['a','c']) FROM patches;

Output:

 f
(1 rows)

The result f (false) means the points in pa are not sorted along dimensions a and c.