Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
ST_IsRing
ST_IsRing returns true if the input linestring is a ring. A linestring is a ring if it is closed and simple.
Syntax
ST_IsRing(geom)
Arguments
- geom
-
A value of data type
GEOMETRYor an expression that evaluates to aGEOMETRYtype. The geometry must be aLINESTRING.
Return type
BOOLEAN
If geom is not a LINESTRING, then an error is returned.
Examples
The following SQL checks if the specified linestring is a ring.
SELECT ST_IsRing(ST_GeomFromText('linestring(0 0, 1 1, 1 2, 0 0)'));
st_isring
-----------
true