# generate_series — DuckDB 2.0.0

Creates a list of values between `start` and `stop` - the stop parameter is inclusive.

- Reference: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/
- JSON: /products/haybarn/functions/api/v1/duckdb-2.0.0/functions/generate_series.json
- Snapshot ID: duckdb-2.0.0
- Engine: duckdb v2.0.0
- Source ID: d54cbbe3df
- Binary SHA-256: 4d5d001f4b0a16c16f1bc83338153a70bec7e58f0cae0eec4b44b9b9afa0bef0
- Captured: 2026-11-06T18:35:28.343Z
- Source: https://github.com/duckdb/duckdb/releases/tag/v2.0.0
- Loaded extensions: autocomplete, core_functions, icu, json, parquet, shell

## Interpretation

- Choose a snapshot matching the target engine and build. The default is captured from the published Haybarn WASM package used by the browser playground. Historical native snapshots are also available.
- Availability is an observation in the recorded build and extension profile, not a guarantee of support in every installation or in WASM.
- Types and descriptions are declarations from duckdb_functions(). Binding can specialize result types. Null means not supplied by the catalog; do not invent defaults, optionality, argument mode, or table output columns.
- Raw parameter arrays preserve catalog order for scalar/aggregate/macro functions. Raw table arguments are alphabetical. Use callingConvention for engine-confirmed positional order and named arguments; null modes are unrecorded. Named does not mean optional. Macro defaults and special named variadic behavior are not supplied by duckdb_functions().
- Catalog examples are source material and may require data or extensions. runnableExamples contains separately verified SQL for the pinned WASM package; sample-data adaptations and guide examples are labeled separately.
- Guide annotations and recipes are separate editorial content. The browser runner always uses Haybarn WASM 2.0.0-rc12, independently of the documentation snapshot.
- All URLs beginning with / are relative to the origin hosting this document. Exports require no JavaScript, cookies, API key, or browser engine.

## Overloads

### overload-0b2a1b153782f251

Kind: scalar. Parameter order: catalog-order.

```text
generate_series(stop: BIGINT) → BIGINT[]
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-0b2a1b153782f251

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| stop | BIGINT | not recorded |

Declared return type: BIGINT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-c5fed6c0b9b32be0

Kind: scalar. Parameter order: catalog-order.

```text
generate_series(start: BIGINT, stop: BIGINT) → BIGINT[]
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-c5fed6c0b9b32be0

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | BIGINT | not recorded |
| stop | BIGINT | not recorded |

Declared return type: BIGINT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-2149173e578f62c1

Kind: scalar. Parameter order: catalog-order.

```text
generate_series(start: BIGINT, stop: BIGINT, step: BIGINT) → BIGINT[]
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-2149173e578f62c1

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | BIGINT | not recorded |
| stop | BIGINT | not recorded |
| step | BIGINT | not recorded |

Declared return type: BIGINT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-b1b3c3276af333db

Kind: scalar. Parameter order: catalog-order.

```text
generate_series(start: TIMESTAMP WITH TIME ZONE, stop: TIMESTAMP WITH TIME ZONE, step: INTERVAL) → TIMESTAMP WITH TIME ZONE[]
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-b1b3c3276af333db

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | TIMESTAMP WITH TIME ZONE | not recorded |
| stop | TIMESTAMP WITH TIME ZONE | not recorded |
| step | INTERVAL | not recorded |

Declared return type: TIMESTAMP WITH TIME ZONE[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-9aedded040cc463f

Kind: scalar. Parameter order: catalog-order.

```text
generate_series(start: TIMESTAMP, stop: TIMESTAMP, step: INTERVAL) → TIMESTAMP[]
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-9aedded040cc463f

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | TIMESTAMP | not recorded |
| stop | TIMESTAMP | not recorded |
| step | INTERVAL | not recorded |

Declared return type: TIMESTAMP[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-456afce064b6f8c5

Kind: table. Parameter order: alphabetical-not-call-order.

```text
generate_series(stop: BIGINT) → TABLE
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-456afce064b6f8c5

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| stop | BIGINT | positional (position 1) |

Declared return type: unknown. Variadic argument type: none declared.
Stability: unknown. Declared side effects: unknown.

### overload-3453cce2040849c2

Kind: table. Parameter order: alphabetical-not-call-order.

```text
generate_series(start: BIGINT, stop: BIGINT) → TABLE
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-3453cce2040849c2

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | BIGINT | positional (position 1) |
| stop | BIGINT | positional (position 2) |

Declared return type: unknown. Variadic argument type: none declared.
Stability: unknown. Declared side effects: unknown.

### overload-dc85b3856890399d

Kind: table. Parameter order: alphabetical-not-call-order.

```text
generate_series(start: BIGINT, stop: BIGINT, step: BIGINT) → TABLE
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-dc85b3856890399d

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | BIGINT | positional (position 1) |
| step | BIGINT | positional (position 3) |
| stop | BIGINT | positional (position 2) |

Declared return type: unknown. Variadic argument type: none declared.
Stability: unknown. Declared side effects: unknown.

### overload-77989881cb417374

Kind: table. Parameter order: alphabetical-not-call-order.

```text
generate_series(start: TIMESTAMP WITH TIME ZONE, stop: TIMESTAMP WITH TIME ZONE, step: INTERVAL) → TABLE
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-77989881cb417374

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | TIMESTAMP WITH TIME ZONE | positional (position 1) |
| step | INTERVAL | positional (position 3) |
| stop | TIMESTAMP WITH TIME ZONE | positional (position 2) |

Declared return type: unknown. Variadic argument type: none declared.
Stability: unknown. Declared side effects: unknown.

### overload-af54f285d954376b

Kind: table. Parameter order: alphabetical-not-call-order.

```text
generate_series(start: TIMESTAMP, stop: TIMESTAMP, step: INTERVAL) → TABLE
```

Link: /products/haybarn/functions/releases/duckdb-2.0.0/generate_series/#overload-af54f285d954376b

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| start | TIMESTAMP | positional (position 1) |
| step | INTERVAL | positional (position 3) |
| stop | TIMESTAMP | positional (position 2) |

Declared return type: unknown. Variadic argument type: none declared.
Stability: unknown. Declared side effects: unknown.


## Guide recipes

No guide recipes.

## Engine catalog examples

Source examples may require additional data or extensions. Expressions are wrapped in SELECT; execution verification is not recorded.

Reported for: overload-0b2a1b153782f251, overload-c5fed6c0b9b32be0, overload-2149173e578f62c1, overload-b1b3c3276af333db, overload-9aedded040cc463f

```sql
SELECT generate_series(2, 5, 3);
```

## Runnable examples

Executed successfully in Haybarn WASM 2.0.0-rc12. Sample data and guide examples are separate from the original catalog.

```sql
SELECT generate_series(2, 5, 3);
```

## Additional DuckDB documentation

- [Reading and Writing Parquet Files](https://duckdb.org/docs/current/data/parquet/overview#examples)
- [Parquet Tips](https://duckdb.org/docs/current/data/parquet/tips#enabling-per_thread_output)
- [List Functions](https://duckdb.org/docs/current/sql/functions/list#generate_seriesstart-stop-step-1)

## In other engines

### PostgreSQL

Uses generate_series as part of a larger rewrite.

PostgreSQL:

```sql
WITH dates AS (SELECT GENERATE_SERIES('2020-01-01'::DATE, '2024-01-01'::DATE, '1 day'::INTERVAL) AS date), date_table AS (SELECT DISTINCT DATE_TRUNC('MONTH', date) AS date FROM dates) SELECT * FROM date_table
```

Haybarn / DuckDB:

```sql
WITH dates AS (SELECT UNNEST(GENERATE_SERIES(CAST('2020-01-01' AS DATE), CAST('2024-01-01' AS DATE), CAST('1 day' AS INTERVAL))) AS date), date_table AS (SELECT DISTINCT DATE_TRUNC('MONTH', date) AS date FROM dates) SELECT * FROM date_table
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_postgres.py#L787).

### BigQuery: generate_array()



BigQuery:

```sql
GENERATE_ARRAY(1, 4)
```

Haybarn / DuckDB:

```sql
GENERATE_SERIES(1, 4)
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_bigquery.py#L1768).

### Dremio: array_generate_range()



Dremio:

```sql
ARRAY_GENERATE_RANGE(1, 4)
```

Haybarn / DuckDB:

```sql
GENERATE_SERIES(1, 4)
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_dremio.py#L213).

### Snowflake: array_except()

Uses generate_series as part of a larger rewrite.

Snowflake:

```sql
SELECT ARRAY_EXCEPT([1, 2, 3], [2])
```

Haybarn / DuckDB:

```sql
SELECT CASE WHEN [1, 2, 3] IS NULL OR [2] IS NULL THEN NULL ELSE LIST_TRANSFORM(LIST_FILTER(LIST_ZIP([1, 2, 3], GENERATE_SERIES(1, LENGTH([1, 2, 3]))), pair -> (LENGTH(LIST_FILTER([1, 2, 3][1:pair[2]], e -> e IS NOT DISTINCT FROM pair[1])) > LENGTH(LIST_FILTER([2], e -> e IS NOT DISTINCT FROM pair[1])))), pair -> pair[1]) END
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_snowflake.py#L6835).

## Observed availability

| Snapshot | Observed | Overloads | JSON |
| --- | --- | --- | --- |
| haybarn-2.0.0-rc12 | present | 10 | [reference](/products/haybarn/functions/api/v1/haybarn-2.0.0-rc12/functions/generate_series.json) |
| haybarn-2.0.0-rc11 | present | 10 | [reference](/products/haybarn/functions/api/v1/haybarn-2.0.0-rc11/functions/generate_series.json) |
| haybarn-2.0.0-rc8 | present | 10 | [reference](/products/haybarn/functions/api/v1/haybarn-2.0.0-rc8/functions/generate_series.json) |
| haybarn-1.5.5-rc3 | present | 10 | [reference](/products/haybarn/functions/api/v1/haybarn-1.5.5-rc3/functions/generate_series.json) |
| haybarn-1.5.6-rc6 | present | 10 | [reference](/products/haybarn/functions/api/v1/haybarn-1.5.6-rc6/functions/generate_series.json) |
| duckdb-2.0.0 | present | 10 | [reference](/products/haybarn/functions/api/v1/duckdb-2.0.0/functions/generate_series.json) |
| duckdb-1.5.6 | present | 10 | [reference](/products/haybarn/functions/api/v1/duckdb-1.5.6/functions/generate_series.json) |
| duckdb-1.5.5 | present | 10 | [reference](/products/haybarn/functions/api/v1/duckdb-1.5.5/functions/generate_series.json) |
| duckdb-1.4.4 | present | 10 | [reference](/products/haybarn/functions/api/v1/duckdb-1.4.4/functions/generate_series.json) |
| duckdb-1.3.2 | present | 10 | [reference](/products/haybarn/functions/api/v1/duckdb-1.3.2/functions/generate_series.json) |

Engine catalog documentation is derived from MIT-licensed Haybarn and DuckDB. [Notices](/third-party-notices.txt).
