Skip to content
masterclass Buddy

PostgreSQL · Function

generate_series

generate_series creates a set of values from start to stop. You can choose the step and use numbers or timestamps.

Last updated

Syntax

generate_series(start, stop [, step])
generate_series(start timestamp, stop timestamp, step interval)
generate_series(start timestamp with time zone, stop timestamp with time zone, step interval [, timezone text])

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • LATERAL
  • ROWS FROM
  • timestamp with time zone

Source: PostgreSQL: Documentation: 18: 9.26. Set Returning Functions. Checked 2026-11-03.