Determines whether the geometry is a valid spatial object.
SELECT ST_Geometry::ST_GeomFromText( 'Polygon(( 0 0, 4 0, 4 5, 0 -1, 0 0 ))' ) .ST_IsValid()
The following returns the result 0 because the polygons within the geometry self-intersect at a surface. Note that self-intersections of a geometry collection at finite number of points is considered valid.
SELECT ST_Geometry::ST_GeomFromText( 'MultiPolygon((( 0 0, 2 0, 1 2, 0 0 )),((0 2, 1 0, 2 2, 0 2)))' ) .ST_IsValid()
SQL/MM (ISO/IEC 13249-3: 2006) 5.1.9