↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Functions

generate_series

Generates a series of values from start to stop, with a step size of step. step defaults to 1.

English manual coverage begins with PostgreSQL 7.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

group
srf
group label
Set Returning Functions
lang
en
layout
table-new
pages
functions-srf.html
prose only
false

Definition PG 18

Generates a series of values from start to stop, with a step size of step. step defaults to 1.

Signatures and overloads

generate_series ( start integer, stop integer [, step integer ] ) → setof integer → setof integer
Generates a series of values from start to stop, with a step size of step. step defaults to 1.
generate_series ( start bigint, stop bigint [, step bigint ] ) → setof bigint → setof bigint
Generates a series of values from start to stop, with a step size of step. step defaults to 1.
generate_series ( start numeric, stop numeric [, step numeric ] ) → setof numeric → setof numeric
Generates a series of values from start to stop, with a step size of step. step defaults to 1.
generate_series ( start timestamp, stop timestamp, step interval ) → setof timestamp → setof timestamp
Generates a series of values from start to stop, with a step size of step. In the timezone-aware form, times of day and daylight-savings adjustments are computed according to the time zone named by the timezone argument, or the current TimeZone setting if that is omitted.
generate_series ( start timestamp with time zone, stop timestamp with time zone, step interval [, timezone text ] ) → setof timestamp with time zone → setof timestamp with time zone
Generates a series of values from start to stop, with a step size of step. In the timezone-aware form, times of day and daylight-savings adjustments are computed according to the time zone named by the timezone argument, or the current TimeZone setting if that is omitted.

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:1c2304e30569a0aebdaeba0dd4c7971094d93c08102f5e19dbbab56207d69e79

Text language: en · wiki-repair-20261023:1c2304e30569a0aebdaeba0dd4c7971094d93c08102f5e19dbbab56207d69e79