pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。
相对 PostgreSQL 15 的差异:16 共有 633 个函数、822 条签名。
「签名变化」指函数还在,但它的签名有增有删;只改说明文字不计入。「换了分组」指手册把这个函数挪到了另一页。
erf数学函数和操作符
误差函数
erf ( double precision ) → double precision
erfc数学函数和操作符
互补误差函数(1 - erf(x),对较大输入不会损失精度)
erfc ( double precision ) → double precision
random_normal数学函数和操作符
在Table 9.6和Table 9.33中列出的random()和random_normal()函数使用同一个确定性伪随机数生成器。
random_normal ( [ mean double precision [, stddev double precision ]] ) → double precision
date_add时间/日期函数和操作符
将一个 interval 加到 timestamp with time zone 上,并根据第三个参数命名的时区,或在省略该参数时根据当前TimeZone设置,计算时刻和夏令时调整。
date_add ( timestamp with time zone, interval [, text ] ) → timestamp with time zone
date_subtract时间/日期函数和操作符
从一个 timestamp with time zone 中减去 interval,并根据第三个参数命名的时区,或在省略该参数时根据当前TimeZone设置,计算时刻和夏令时调整。
date_subtract ( timestamp with time zone, interval [, text ] ) → timestamp with time zone
json_arrayJSON 函数和操作符
根据一系列value_expression参数或query_expression的结果构造 JSON 数组;后者必须是只返回一列的 SELECT 查询。
json_array ( [ { value_expression [ FORMAT JSON ] } [, ...] ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])
array_sample数组函数和操作符
从array中随机选取n个项并返回一个数组。
array_sample ( array anyarray, n integer ) → anyarray
array_shuffle数组函数和操作符
随机打乱数组的第一维。
array_shuffle ( anyarray ) → anyarray
any_value聚合函数
从非空输入值中返回任意一个值。
any_value ( anyelement ) → same as input type
json_agg_strict聚合函数
收集所有输入值,跳过空值,到一个JSON数组。
json_agg_strict ( anyelement ) → json
json_arrayagg聚合函数
行为与json_array相同,只是它作为一个聚合函数,因此只接受一个 value_expression参数。
json_arrayagg ( [ value_expression ] [ ORDER BY sort_expression ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])
将所有键/值对收集到一个JSON对象中。
json_object_agg_strict ( key "any", value "any" ) → json
将所有键/值对收集到一个JSON对象中。
json_object_agg_unique ( key "any", value "any" ) → json
json_object_agg_unique_strict聚合函数
将所有键/值对收集到一个JSON对象中。
json_object_agg_unique_strict ( key "any", value "any" ) → json
json_objectagg聚合函数
行为与json_object相同,只是它作为一个聚合函数,因此只接受一个 key_expression参数和一个 value_expression参数。
json_objectagg ( [ { key_expression { VALUE | ':' } value_expression } ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])
jsonb_agg_strict聚合函数
收集所有输入值,跳过空值,到一个JSON数组。
jsonb_agg_strict ( anyelement ) → jsonb
将所有键/值对收集到一个JSON对象中。
jsonb_object_agg_strict ( key "any", value "any" ) → jsonb
将所有键/值对收集到一个JSON对象中。
jsonb_object_agg_unique ( key "any", value "any" ) → jsonb
jsonb_object_agg_unique_strict聚合函数
将所有键/值对收集到一个JSON对象中。
jsonb_object_agg_unique_strict ( key "any", value "any" ) → jsonb
pg_get_partkeydef系统信息函数和操作符
重构分区表分区键的定义,以其在 PARTITION BY 子句中的形式出现。
pg_get_partkeydef ( table oid ) → text
pg_input_error_info系统信息函数和操作符
测试给定的string是否是指定数据类型的有效 输入;如果不是,则返回本应抛出的错误详情。
pg_input_error_info ( string text, type text ) → record ( message text, detail text, hint text, sql_error_code text )
pg_input_is_valid系统信息函数和操作符
测试给定的string是否是指定数据类型的有效输入,返回 true 或 false。
pg_input_is_valid ( string text, type text ) → boolean
system_user系统信息函数和操作符
返回用户在被分配数据库角色之前,于认证周期中提供的认证方法和身份(如果有)。
system_user → text
pg_log_standby_snapshot系统管理函数
Take a snapshot of running transactions and write it to WAL, without having to wait for bgwriter or checkpointer to log one.
pg_log_standby_snapshot () → pg_lsn
pg_split_walfile_name系统管理函数
从 WAL 文件名中提取序列号和时间线 ID。
pg_split_walfile_name ( file_name text ) → record ( segment_number numeric, timeline_id bigint )
这一版没有移除函数。
| 函数 | 分组 | 增删 | 第一条新增签名 |
|---|---|---|---|
json_object |
JSON 函数和操作符 | +1 | json_object ( [ { key_expression { VALUE | ':' } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ]) |
generate_series |
集合返回函数 | +1−1 | generate_series ( start timestamp with time zone, stop timestamp with time zone, step interval [, timezone text ] ) → setof timestamp with time zone |
pg_read_binary_file |
系统管理函数 | +1−1 | pg_read_binary_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → bytea |
pg_read_file |
系统管理函数 | +1−1 | pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text |
这一版没有函数换分组。