ST_NRings — If the geometry is a polygon or multi-polygon returns the number of rings.
integer ST_NRings(geometry  geomA);
If the geometry is a polygon or multi-polygon returns the number of rings. Unlike NumInteriorRings, it counts the outer rings as well.
 This function supports 3d and will not drop the z-index.
 This function supports 3d and will not drop the z-index.
 This method supports Circular Strings and Curves
 This method supports Circular Strings and Curves