pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。
相对 PostgreSQL 13 的差异:14.25 共有 597 个函数、783 条签名。
「签名变化」指函数还在,但它的签名有增有删;只改说明文字不计入。「换了分组」指手册把这个函数挪到了另一页。
string_to_table字符串函数和操作符
在出现 delimiter 时拆分 string,并将结果字段作为 text 行的集合返回。如果 delimiter 为 NULL,则 string 中的每个字符将成为结果的单独一行。如果 delimiter 为空字符串,则将 string 视为单个字段。如果提供了 null_string,并且不是 NULL,则匹配该字符串的字段将被 NULL 替换。
string_to_table ( string text, delimiter text [, null_string text] ) → setof text
unistr字符串函数和操作符
解析参数中转义的 Unicode 字符。Unicode 字符可以被指定为\XXXX(4 个十六进制数字),\+XXXXXX(6 个十六进制数字),\uXXXX(4 个十六进制数字),或\UXXXXXXXX(8 个十六进制数字)。要指定反斜杠,请写入两个反斜杠。所有其他字符均按字面解释。
unistr ( text ) → text
bit_count二进制串函数和操作符
返回二进制字符串中被置位的位数(也称为“popcount”)。
bit_count ( bytes bytea ) → bigint
date_bin时间/日期函数和操作符
将输入按指定的间隔进行分箱(bin),对齐到指定的原点;参见第 9.9.3 节
date_bin ( interval, timestamp, timestamp ) → timestamp
trim_array数组函数和操作符
通过删除最后的 n 个元素来裁剪数组。如果数组是多维的,则只裁剪第一个维度。
trim_array ( array anyarray, n integer ) → anyarray
multirange范围/多范围函数和操作符
返回仅包含给定范围的多范围。
multirange ( anyrange ) → anymultirange
bit_xor聚合函数
计算所有非空输入值的按位异或。可用作一组无序的值集合的校验和。
bit_xor ( smallint ) → smallint
range_agg聚合函数
计算非空输入值的并集。
range_agg ( value anyrange ) → anymultirange
计算非空输入值的交集。
range_intersect_agg ( value anyrange ) → anyrange
pg_get_catalog_foreign_keys系统信息函数和操作符
返回一组记录,描述存在于 PostgreSQL 系统目录中的外键关系。fktable 列包含引用目录的名称,fkcols 列包含引用列的名称。类似地,pktable 列包含被引用目录的名称,而 pkcols 列包含被引用列的名称。如果 is_array 为真,则最后一个引用列是一个数组,其每个元素都应该与被引用目录中的某个条目匹配。如果 is_opt 为真,则允许引用列包含零而不是有效引用。
pg_get_catalog_foreign_keys () → setof record ( fktable regclass, fkcols text[], pktable regclass, pkcols text[], is_array boolean, is_opt boolean )
pg_get_partition_constraintdef系统信息函数和操作符
重建分区约束的定义。(这是反编译重建的结果,并非命令的原始文本。)
pg_get_partition_constraintdef ( table oid ) → text
pg_xact_commit_timestamp_origin系统信息函数和操作符
返回事务的提交时间戳和复制源。
pg_xact_commit_timestamp_origin ( xid ) → record ( timestamp timestamp with time zone, roident oid)
pg_column_compression系统管理函数
显示用于压缩单个变长值的压缩算法。如果值没有被压缩,则返回 NULL。
pg_column_compression ( "any" ) → text
pg_get_wal_replay_pause_state系统管理函数
返回恢复暂停状态。如果没有请求暂停,返回值是 not paused,如果请求暂停但恢复还没有暂停,返回值是 pause requested,如果恢复实际已经暂停,返回值是 paused。
pg_get_wal_replay_pause_state () → text
pg_log_backend_memory_contexts系统管理函数
请求记录具有指定进程 ID 的后端进程的内存上下文。此函数可以向除日志记录进程以外的后端进程和辅助进程发送请求。这些内存上下文将以 LOG 消息级别记录,并根据日志配置出现在服务器日志中(详见第 19.8 节);无论 client_min_messages 如何设置,都不会发送给客户端。
pg_log_backend_memory_contexts ( pid integer ) → boolean
这一版没有移除函数。
| 函数 | 分组 | 增删 | 第一条新增签名 |
|---|---|---|---|
width_bucket |
数学函数和操作符 | +1−1 | width_bucket ( operand anycompatible, thresholds anycompatiblearray ) → integer |
lower |
字符串函数和操作符 | +1 | lower ( anymultirange ) → anyelement |
ltrim |
字符串函数和操作符 | +1 | ltrim ( bytes bytea, bytesremoved bytea ) → bytea |
parse_ident |
字符串函数和操作符 | +1−1 | parse_ident ( str text [, strict boolean DEFAULT true ] ) → text[] |
rtrim |
字符串函数和操作符 | +1 | rtrim ( bytes bytea, bytesremoved bytea ) → bytea |
substring |
字符串函数和操作符 | +2 | substring ( string text SIMILAR pattern text ESCAPE escape text ) → text |
trim |
字符串函数和操作符 | +2−2 | trim ( [LEADING | TRAILING | BOTH] bytesremoved bytea FROM bytes bytea ) → bytea |
upper |
字符串函数和操作符 | +1 | upper ( anymultirange ) → anyelement |
extract |
时间/日期函数和操作符 | +2−2 | extract ( field from timestamp ) → numeric |
make_timestamp |
时间/日期函数和操作符 | +1−1 | make_timestamp ( year int, month int, mday int, hour int, min int, sec double precision ) → timestamp |
make_timestamptz |
时间/日期函数和操作符 | +1−1 | make_timestamptz ( year int, month int, mday int, hour int, min int, sec double precision [, timezone text] ) → timestamp with time zone |
ts_parse |
文本搜索函数和操作符 | +2−2 | ts_parse ( parser_name text, txt text ) → setof record ( tokid integer, token text ) |
ts_stat |
文本搜索函数和操作符 | +1−1 | ts_stat ( query text [, weights text] ) → setof record ( word text, ndoc integer, nentry integer ) |
unnest |
文本搜索函数和操作符 | +1 | unnest ( anymultirange ) → setof anyrange |
table_to_xml |
XML 函数 | +1−1 | table_to_xml ( tbl regclass, nulls boolean, tableforest boolean, targetns text ) → xml |
table_to_xml_and_xmlschema |
XML 函数 | +1−1 | table_to_xml_and_xmlschema ( tbl regclass, nulls boolean, tableforest boolean, targetns text ) → xml |
table_to_xmlschema |
XML 函数 | +1−1 | table_to_xmlschema ( tbl regclass, nulls boolean, tableforest boolean, targetns text ) → xml |
jsonb_insert |
JSON 函数和操作符 | +1−1 | jsonb_insert ( jsonb_in jsonb, path text[], replacement jsonb [, insert_after boolean] ) → jsonb |
jsonb_set |
JSON 函数和操作符 | +1−1 | jsonb_set ( jsonb_in jsonb, path text[], replacement jsonb [, create_if_missing boolean] ) → jsonb |
jsonb_set_lax |
JSON 函数和操作符 | +1−1 | jsonb_set_lax ( jsonb_in jsonb, path text[], replacement jsonb [, create_if_missing boolean [, null_value_treatment text]] ) → jsonb |
array_append |
数组函数和操作符 | +1−1 | array_append ( anycompatiblearray, anycompatible ) → anycompatiblearray |
array_cat |
数组函数和操作符 | +1−1 | array_cat ( anycompatiblearray, anycompatiblearray ) → anycompatiblearray |
array_position |
数组函数和操作符 | +1−1 | array_position ( anycompatiblearray, anycompatible [, integer ] ) → integer |
array_positions |
数组函数和操作符 | +1−1 | array_positions ( anycompatiblearray, anycompatible ) → integer[] |
array_prepend |
数组函数和操作符 | +1−1 | array_prepend ( anycompatible, anycompatiblearray ) → anycompatiblearray |
array_remove |
数组函数和操作符 | +1−1 | array_remove ( anycompatiblearray, anycompatible ) → anycompatiblearray |
array_replace |
数组函数和操作符 | +1−1 | array_replace ( anycompatiblearray, anycompatible, anycompatible ) → anycompatiblearray |
isempty |
范围/多范围函数和操作符 | +1 | isempty ( anymultirange ) → boolean |
lower_inc |
范围/多范围函数和操作符 | +1 | lower_inc ( anymultirange ) → boolean |
lower_inf |
范围/多范围函数和操作符 | +1 | lower_inf ( anymultirange ) → boolean |
range_merge |
范围/多范围函数和操作符 | +1 | range_merge ( anymultirange ) → anyrange |
upper_inc |
范围/多范围函数和操作符 | +1 | upper_inc ( anymultirange ) → boolean |
upper_inf |
范围/多范围函数和操作符 | +1 | upper_inf ( anymultirange ) → boolean |
max |
聚合函数 | +1−1 | max ( 见说明 ) → 与输入类型相同 |
min |
聚合函数 | +1−1 | min ( 见说明 ) → 与输入类型相同 |
stddev |
聚合函数 | +1−1 | stddev ( numeric_type ) → 对于 real 或 double precision 输入,返回 double precision;否则返回 numeric |
stddev_pop |
聚合函数 | +1−1 | stddev_pop ( numeric_type ) → 对于 real 或 double precision 输入,返回 double precision;否则返回 numeric |
stddev_samp |
聚合函数 | +1−1 | stddev_samp ( numeric_type ) → 对于 real 或 double precision 输入,返回 double precision;否则返回 numeric |
var_pop |
聚合函数 | +1−1 | var_pop ( numeric_type ) → 对于 real 或 double precision 输入,返回 double precision;否则返回 numeric |
var_samp |
聚合函数 | +1−1 | var_samp ( numeric_type ) → 对于 real 或 double precision 输入,返回 double precision;否则返回 numeric |
variance |
聚合函数 | +1−1 | variance ( numeric_type ) → 对于 real 或 double precision 输入,返回 double precision;否则返回 numeric |
lag |
窗口函数 | +1−1 | lag ( value anycompatible [, offset integer [, default anycompatible ]] ) → anycompatible |
lead |
窗口函数 | +1−1 | lead ( value anycompatible [, offset integer [, default anycompatible ]] ) → anycompatible |
pg_get_keywords |
系统信息函数和操作符 | +1−1 | pg_get_keywords () → setof record ( word text, catcode "char", barelabel boolean, catdesc text, baredesc text ) |
pg_last_committed_xact |
系统信息函数和操作符 | +1−1 | pg_last_committed_xact () → record ( xid xid, timestamp timestamp with time zone, roident oid ) |
pg_create_logical_replication_slot |
系统管理函数 | +1−1 | pg_create_logical_replication_slot ( slot_name name, plugin name [, temporary boolean, twophase boolean] ) → record ( slot_name name, lsn pg_lsn ) |
pg_terminate_backend |
系统管理函数 | +1−1 | pg_terminate_backend ( pid integer, timeout bigint DEFAULT 0 ) → boolean |
string_to_array
数组函数和操作符
字符串函数和操作符