Set Returning Functions
Set Returning Functions
This section describes functions that possibly return more than one row. The most widely used functions in this class are series generating functions, as detailed in Table 8.52 and Table 8.53. Other, more specialized set-returning functions are described elsewhere in this manual.
Table Series Generating Functions
Function Description |
---|
Generates a series of values from |
Generates a series of values from |
When step
is positive, zero rows are returned if start
is greater than stop
. Conversely, when step
is negative, zero rows are returned if start
is less than stop
. Zero rows are also returned if any input is NULL
. It is an error for step
to be zero. Some examples follow:
Table Subscript Generating Functions
Function Description |
---|
Generates a series comprising the valid subscripts of the |
Generates a series comprising the valid subscripts of the |
generate_subscripts
is a convenience function that generates the set of valid subscripts for the specified dimension of the given array. Zero rows are returned for arrays that do not have the requested dimension, or if any input is NULL
. Some examples follow:
When a function in the FROM
clause is suffixed by WITH ORDINALITY
, a bigint
column is appended to the function's output column(s), which starts from 1 and increments by 1 for each row of the function's output. This is most useful in the case of set returning functions such as unnest()
.