Returns the number of interior rings of an ST_Geometry type that represents an ST_Polygon value.
Returns an INTEGER value.
ST_Polygon
SELECT skey
FROM sample_shapes
WHERE shape.ST_NumInteriorRing() < 4
ORDER BY skey;