PostgreSQL popen() Function

The PostgreSQL popen() function converts the specified path to an open path.

popen() Syntax

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

popen(path) -> path

Parameters

path

Required. A path. For example: path '[(0,0),(1,1),(2,0)]'.

Return value

The PostgreSQL popen() function returns the open form of the path specified by the argument. If the path specified by the parameter is itself an open path, the original path is returned.

popen() Examples

The following statement shows how to use the PostgreSQL popen() function to convert a path path '((0,0),(1,1),(2,0))' to its open form.

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

The following statement shows how to use the PostgreSQL popen() function to convert a path path '[(0,0),(1,1),(2,0)]' to its open form.

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

Here, because path '[(0,0),(1,1),(2,0)]' is open, itself is returned.