generate_series()

A system function for generating a series of values

generate_series() is a system function for generating a series of values (either numeric or time-based).

generate_series() was added in PostgreSQL 8.0.

Change history

Examples

Basic execution of generate_series():

postgres=# SELECT generate_series(1,5);
 generate_series 
-----------------
               1
               2
               3
               4
               5
(5 rows)

Categories

DDL, System function