Tests if an ST_Geometry type that represents an ST_LineString or a GeoSequence value is a ring.
Returns an INTEGER value:
ST_LineString or GeoSequence
ST_IsRing returns zero if the geometry value passed to it is the empty set.
SELECT skey
FROM sample_shapes
WHERE shape.ST_IsRing() = 0
ORDER BY skey;