All Products
Search
Document Center

PolarDB:ST_NumInteriorRing

Last Updated:Mar 28, 2026

Returns the number of interior rings of the input geometry object.

Syntax

integer ST_NumInteriorRing(geometry aPolygon);

Parameters

ParameterDescription
aPolygonThe geometry object that you want to specify.

Examples

Count interior rings in a single polygon

The following example returns the number of interior rings in a polygon that contains one hole.

SELECT ST_NumInteriorRing('POLYGON((1 0,0 3,3 0,1 0),(1 0,2 0,0 2,1 0))'::geometry);
 st_numinteriorring
--------------------
                  1
(1 row)