PostgreSQL lseg(point,point) Function

The PostgreSQL lseg(point,point) function constructs a line segment from two specified points and returns it.

lseg(point,point) Syntax

This is the syntax of the PostgreSQL lseg(point,point) function:

lseg(point1, point1) -> lseg

Parameters

point1

Required. A point. For example: point '(0,0)'.

point2

Required. A point. For example: point '(4,4)'.

Return value

The PostgreSQL lseg() function returns a line segment constructed from two specified points.

lseg() Examples

The following statement shows how to construct a line segment using the PostgreSQL lseg() function.

SELECT lseg(point '(4,4)', point '(0,0)');
     lseg
---------------
 [(4,4),(0,0)]