PostgreSQL isclosed() Function
The PostgreSQL isclosed()
function checks whether a given path is closed.
isclosed()
Syntax
This is the syntax of the PostgreSQL isclosed()
function:
isclosed(path) -> boolean
Parameters
path
-
Required. A path to check. For example:
path '((0,0),(1,1),(2,0))'
.
Return value
The PostgreSQL isclosed()
function returns a boolean value indicating whether the given path is closed. Returns t
if the given path is closed; otherwise returns f
.
isclosed()
Examples
The following statement shows how to use the PostgreSQL isclosed()
function to check whether the path path '((0,0),(1,1),(2,0))'
is closed.
SELECT isclosed(path '((0,0),(1,1),(2,0))');
isclosed
----------
t
Here, because the path '((0,0),(1,1),(2,0))'
is closed, this function returns t
.
The following statement shows how to use the PostgreSQL isclosed()
function to check whether the path path '[(0,0),(1,1),(2,0)]'
is closed.
SELECT isclosed(path '[(0,0),(1,1),(2,0)]');
isclosed
----------
f
Here, because the path '((0,0),(1,1),(2,0))'
is not closed, the function returns f
.