↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / Set Returning Functions

generate_series

Read the PG 18 manual

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

Reading PG 18current·documented in 23 of 27 versions, 8.0 to 20

Signatures & examples

generate_series ( start integer, stop integer [, step 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
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
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
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
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.
Version history 5
  1. 15 → 16 changed
  2. 12 → 13 changed
  3. 9.4 → 9.5 changed
  4. 8.3 → 8.4 changed
  5. 7.4 → 8.0 added

Definition snapshot: b7bd9cda · English manual source