PostgreSQL lower(range) Function
The PostgreSQL lower(range) function returns the lower bound of a given range or multirange.
PostgreSQL lower(range) Syntax
Here is the syntax of the PostgreSQL lower(range) function:
lower(anyrange) -> anyelement
lower(anymultirange) -> anyelement
Parameters
anyrange-
Required. A range value.
anymultirange-
Required. A multirange value.
Return value
The PostgreSQL lower(range) function returns the lower bound of a given range or multirange.
If the given range is empty, or the lower bound of the range is infinite, the PostgreSQL lower(range) function returns NULL.
PostgreSQL lower(range) Examples
Here are some examples of the PostgreSQL lower(range) function.
To extract the lower bound of [1, 4], use the following statement:
SELECT lower('[1, 4]'::int4range);
lower
-------
1To extract the lower bound of (1, 4], use the following statement:
SELECT lower('(1, 4]'::int4range);
lower
-------
2To extract the lower bound of of {[1, 3], [5, 7]}, use the following statement:
SELECT lower('{[1, 3], [5, 7]}'::int4multirange );
lower
-------
1To extract the lower bound of (1, 1), use the following statement:
SELECT lower('(1, 1)'::int4range);
lower
--------
<null>