PostgreSQL isopen() Function

The PostgreSQL isopen() function checks whether a given path is open.

isopen() Syntax

This is the syntax of the PostgreSQL isopen() function:

isopen(path) -> boolean

Parameters

path

Required. A path to check. For example: path '((0,0),(1,1),(2,0))'.

Return value

The PostgreSQL isopen() function returns a boolean value indicating whether a given path is open. Returns t if the given path is open; otherwise returns f.

isopen() Examples

The following statement shows how to use the PostgreSQL isopen() function to check if the path path '((0,0),(1,1),(2,0))' is open.

SELECT isopen(path '((0,0),(1,1),(2,0))');
 isopen
--------
 f

Here, because the path '((0,0),(1,1),(2,0))' is closed, the function returns f.

The following statement shows how to use the PostgreSQL isopen() function to check if the path path '[(0,0),(1,1),(2,0)]' is open.

SELECT isopen(path '[(0,0),(1,1),(2,0)]');
 isopen
--------
 t

Here, because the path '((0,0),(1,1),(2,0))' is not closed, the function returns t.