选择 打开 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

文档 / 函数百科 / 17 变更

PostgreSQL 17 函数变更

相对 PostgreSQL 16 的差异:17 共有 657 个函数、852 条签名。

换一个对比基准

汇总

  1. 24新增函数
  2. 0移除函数
  3. 10签名变化
  4. 0换了分组

「签名变化」指函数还在,但它的签名有增有删;只改说明文字不计入。「换了分组」指手册把这个函数挪到了另一页。

新增函数24

  • to_bin字符串函数和操作符

    将数字转换为等价的二进制补码表示。

    to_bin ( integer ) → text

    2 条签名

  • to_oct字符串函数和操作符

    将数字转换为等价的八进制补码表示。

    to_oct ( integer ) → text

    2 条签名

  • unicode_assigned字符串函数和操作符

    如果字符串中的所有字符都已分配 Unicode 代码点,则返回true;否则返回false。

    unicode_assigned ( text ) → boolean

    1 条签名

  • uuid_extract_timestampUUID 函数

    从版本 1、6 或 7 的 UUID 中提取 timestamp with time zone。

    uuid_extract_timestamp (uuid) → timestamp with time zone

    1 条签名

  • uuid_extract_versionUUID 函数

    从符合 RFC 9562 所描述某一变体的 UUID 中提取版本号。

    uuid_extract_version (uuid) → smallint

    1 条签名

  • xmltextXML 函数

    函数 xmltext 返回一个只包含单个文本节点的 XML 值,该文本节点的内容就是输入参数。

    xmltext ( text ) → xml

    1 条签名

  • jsonJSON 函数和操作符

    将按 UTF8 编码的 text 或 bytea 字符串形式指定的给定表达式转换为 JSON 值。

    json ( expression [ FORMAT JSON [ ENCODING UTF8 ]] [ { WITH | WITHOUT } UNIQUE [ KEYS ]] ) → json

    1 条签名

  • JSON_EXISTSJSON 函数和操作符

    JSON_EXISTS ( context_item, path_expression [PASSING { value AS varname } [, ...]] [{ TRUE | FALSE | UNKNOWN | ERROR } ON ERROR]) → boolean

    1 条签名

  • JSON_QUERYJSON 函数和操作符

    JSON_QUERY ( context_item, path_expression [PASSING { value AS varname } [, ...]] [RETURNING data_type [FORMAT JSON [ENCODING UTF8] ] ] [ { WITHOUT | WITH { CONDITIONAL | [UNCONDITIONAL] } } [ARRAY] WRAPPER] [ { KEEP | OMIT } QUOTES [ON SCALAR STRING] ] [ { ERROR | NULL | EMPTY { [ARRAY] | OBJECT } | DEFAULT expression } ON EMPTY] [ { ERROR | NULL | EMPTY { [ARRAY] | OBJECT } | DEFAULT expression } ON ERROR]) → jsonb

    1 条签名

  • json_scalarJSON 函数和操作符

    将给定的 SQL 标量值转换为 JSON 标量值。

    json_scalar ( expression )

    1 条签名

  • json_serializeJSON 函数和操作符

    将 SQL/JSON 表达式转换为字符或二进制字符串。

    json_serialize ( expression [ FORMAT JSON [ ENCODING UTF8 ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ] )

    1 条签名

  • JSON_TABLEJSON 函数和操作符

    下面更详细地说明每个语法元素。

    JSON_TABLE ( context_item, path_expression [ AS json_path_name] [ PASSING { value AS varname } [, ...] ] COLUMNS ( json_table_column [, ...] ) [ { ERROR | EMPTY [ARRAY]} ON ERROR] )

    1 条签名

  • JSON_VALUEJSON 函数和操作符

    JSON_VALUE ( context_item, path_expression [PASSING { value AS varname } [, ...]] [RETURNING data_type] [ { ERROR | NULL | DEFAULT expression } ON EMPTY] [ { ERROR | NULL | DEFAULT expression } ON ERROR]) → text

    1 条签名

  • jsonb_populate_record_validJSON 函数和操作符

    用于测试jsonb_populate_record。

    jsonb_populate_record_valid ( base anyelement, from_json json ) → boolean

    1 条签名

  • merge_action合并支持函数

    返回为当前行执行的合并操作命令。

    merge_action ( ) → text

    1 条签名

  • icu_unicode_version系统信息函数和操作符

    如果服务器在构建时启用了 ICU 支持,则返回一个表示 ICU 所使用的 Unicode 版本的字符串;否则返回 NULL。

    icu_unicode_version () → text

    1 条签名

  • pg_available_wal_summaries系统信息函数和操作符

    返回数据目录中 pg_wal/summaries下现有 WAL 汇总文件的信息。

    pg_available_wal_summaries () → setof record ( tli bigint, start_lsn pg_lsn, end_lsn pg_lsn )

    1 条签名

  • pg_basetype系统信息函数和操作符

    返回由类型 OID 标识的域的基类型的 OID。

    pg_basetype ( regtype ) → regtype

    1 条签名

  • pg_get_wal_summarizer_state系统信息函数和操作符

    返回有关 WAL 汇总器进度的信息。

    pg_get_wal_summarizer_state () → record ( summarized_tli bigint, summarized_lsn pg_lsn, pending_lsn pg_lsn, summarizer_pid int )

    1 条签名

  • pg_wal_summary_contents系统信息函数和操作符

    返回由 TLI 以及起始和结束 LSN 标识的单个 WAL 汇总文件内容的信息。

    pg_wal_summary_contents ( tli bigint, start_lsn pg_lsn, end_lsn pg_lsn ) → setof record ( relfilenode oid, reltablespace oid, reldatabase oid, relforknumber smallint, relblocknumber bigint, is_limit_block boolean )

    1 条签名

  • to_regtypemod系统信息函数和操作符

    解析文本字符串,从中提取可能的类型名,并转换其类型修饰符(如果存在)。

    to_regtypemod ( text ) → integer

    1 条签名

  • unicode_version系统信息函数和操作符

    返回一个表示PostgreSQL所使用的 Unicode 版本的字符串。

    unicode_version () → text

    1 条签名

  • pg_column_toast_chunk_id系统管理函数

    显示磁盘上已 TOAST 化值的chunk_id。

    pg_column_toast_chunk_id ( "any" ) → oid

    1 条签名

  • pg_sync_replication_slots系统管理函数

    将逻辑故障切换复制槽从主库同步到备库。

    pg_sync_replication_slots () → void

    1 条签名

移除函数0

这一版没有移除函数。

签名变化10

函数 分组 增删 第一条新增签名
random 数学函数和操作符 +3 random ( min integer, max integer ) → integer
xmlagg XML 函数 +1 xmlagg ( xml ORDER BY input_sort_columns ) → xml
array_agg 聚合函数 +2−2 array_agg ( anynonarray ORDER BY input_sort_columns ) → anyarray
json_agg 聚合函数 +1−1 json_agg ( anyelement ORDER BY input_sort_columns ) → json
json_object_agg 聚合函数 +1−1 json_object_agg ( key "any", value "any" ORDER BY input_sort_columns ) → json
jsonb_agg 聚合函数 +1−1 jsonb_agg ( anyelement ORDER BY input_sort_columns ) → jsonb
jsonb_object_agg 聚合函数 +1−1 jsonb_object_agg ( key "any", value "any" ORDER BY input_sort_columns ) → jsonb
string_agg 聚合函数 +1−1 string_agg ( value bytea, delimiter bytea ORDER BY input_sort_columns ) → bytea
pg_create_logical_replication_slot 系统管理函数 +1−1 pg_create_logical_replication_slot ( slot_name name, plugin name [, temporary boolean, twophase boolean, failover boolean ] ) → record ( slot_name name, lsn pg_lsn )
pg_logical_emit_message 系统管理函数 +2−2 pg_logical_emit_message ( transactional boolean, prefix text, content text [, flush boolean DEFAULT false] ) → pg_lsn

换了分组0

这一版没有函数换分组。