FUNCTION集合返回函数
generate_series
从start到stop生成一系列的值,步长为step。
Generates a series of values from start to stop, with a step size of step.
集合返回函数 引入 9.0(基线) 现存至 20 devel 5 条签名 2 次签名变更
- 分组
- 集合返回函数
- 签名数
- 5 条
- 引入版本
- 9.0(基线)
- 状态
- 现存
- 签名变更
- 2 次
- 本版来源
- 本站译文
版本轨迹
相对 PostgreSQL 17 无变化。
签名
PostgreSQL 18 里 generate_series 的 5 条签名,按上游手册顺序排列。参数名用斜体,类型用弱化色, 之后是返回类型。说明取自本站手册译文:标「沿用」的借用了另一版的译文,标「EN」的本站暂无译文、按英文原文显示。
-
generate_series(startinteger,stopinteger[,stepinteger] ) →setof integer从start到stop生成一系列的值,步长为step。step默认为1。 -
generate_series(startbigint,stopbigint[,stepbigint] ) →setof bigint从start到stop生成一系列的值,步长为step。step默认为1。 -
generate_series(startnumeric,stopnumeric[,stepnumeric] ) →setof numeric从start到stop生成一系列的值,步长为step。step默认为1。 -
generate_series(starttimestamp,stoptimestamp,stepinterval) →setof timestamp -
generate_series(starttimestamp with time zone,stoptimestamp with time zone,stepinterval[,timezonetext] ) →setof timestamp with time zone
演化历史
相邻两个大版本之间的差异,新的在前。版本号链到该版的签名。
-
PostgreSQL 16 ← 15 签名变更
generate_series ( start timestamp with time zone, stop timestamp with time zone, step interval [, timezone text ] ) → setof timestamp with time zonegenerate_series ( start timestamp with time zone, stop timestamp with time zone, step interval ) → setof timestamp with time zone -
PostgreSQL 13 ← 12 手册重排
这一跳手册重排了函数表的写法,签名文本整体改写,只记函数的增删,不逐条比较签名。
-
PostgreSQL 9.5 ← 9.4 签名变更
generate_series ( start, stop ) → setof int, setof bigint, or setof numeric (same as argument type)generate_series ( start, stop, step ) → setof int, setof bigint or setof numeric (same as argument type)generate_series ( start, stop ) → setof int or setof bigint (same as argument type)generate_series ( start, stop, step ) → setof int or setof bigint (same as argument type)
签名矩阵
每条签名在给出了签名的 18 个版本里的存在情况;方格指向该版的签名。只在正文里提到此函数、没有给出签名的版本不列进来,上面的版本轨迹里仍然有它们。签名文本在 PostgreSQL 13 前后写法不同,跨越那一跳的同一条签名会显示成两行。
存在 不存在
| 签名 | 9.0 | 9.1 | 9.2 | 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
generate_series ( start, stop ) → setof int or setof bigint (same as argument type) |
存在 | 存在 | 存在 | 存在 | 存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
generate_series ( start, stop, step ) → setof int or setof bigint (same as argument type) |
存在 | 存在 | 存在 | 存在 | 存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
generate_series ( start, stop, step interval ) → setof timestamp or setof timestamp with time zone (same as argument type) |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
generate_series ( start, stop ) → setof int, setof bigint, or setof numeric (same as argument type) |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
generate_series ( start, stop, step ) → setof int, setof bigint or setof numeric (same as argument type) |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
generate_series ( start integer, stop integer [, step integer ] ) → setof integer |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
generate_series ( start bigint, stop bigint [, step bigint ] ) → setof bigint |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
generate_series ( start numeric, stop numeric [, step numeric ] ) → setof numeric |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
generate_series ( start timestamp, stop timestamp, step interval ) → setof timestamp |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
generate_series ( start timestamp with time zone, stop timestamp with time zone, step interval ) → setof timestamp with time zone |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
generate_series ( start timestamp with time zone, stop timestamp with time zone, step interval [, timezone text ] ) → setof timestamp with time zone |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
同组函数
| 函数 | 签名 | 主签名 | 版本变动 | 最近变更 |
|---|---|---|---|---|
generate_series基线 |
5 | generate_series ( start integer, stop integer [, step integer ] ) → setof integer |
162 次 | |
| 从start到stop生成一系列的值,步长为step。 | 现存 | |||
generate_subscripts基线 |
2 | generate_subscripts ( array anyarray, dim integer ) → setof integer |
— | |
| 生成一个包含给定数组第dim维度的有效下标的序列。 | 现存 | |||