View a markdown version of this page

ST_IsRing - Amazon Redshift

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 that was published on June 30, 2025.

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 GEOMETRY or an expression that evaluates to a GEOMETRY type. The geometry must be a LINESTRING.

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