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

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

文档 / 函数百科 / XML 函数

FUNCTIONXML 函数

xmlagg

和这里描述的其他函数不同,函数xmlagg是一个聚合函数。

The function xmlagg is, unlike the other functions described here, an aggregate function.

XML 函数 引入 9.0(基线) 现存至 20 devel 2 条签名 1 次签名变更

分组
XML 函数
签名数
2 条
引入版本
9.0(基线)
状态
现存
签名变更
1 次
本版来源
本站译文

PostgreSQL 18 手册 · 9.15 XML 函数 官方文档

版本轨迹

相对 PostgreSQL 17 无变化。

签名

PostgreSQL 18 里 xmlagg 的 2 条签名,按上游手册顺序排列。参数名用斜体,类型用弱化色, 之后是返回类型。说明取自本站手册译文:标「沿用」的借用了另一版的译文,标「EN」的本站暂无译文、按英文原文显示。

  1. xmlagg ( xml ) → xml

    和这里描述的其他函数不同,函数xmlagg是一个聚合函数。它将聚合函数调用的输入值串接起来,非常像xmlconcat所做的事情,除了串接是跨行发生的而不是在单一行的多个表达式上发生。聚合表达式的更多信息请见Section 9.21
  2. xmlagg ( xml ORDER BY input_sort_columns ) → xml

    ENConcatenates the non-null XML input values (see Section 9.15.1.8).

演化历史

相邻两个大版本之间的差异,新的在前。版本号链到该版的签名。

  1. PostgreSQL 19 ← 18 说明更新

    说明更新

  2. PostgreSQL 17 ← 16 签名变更

    xmlagg ( xml ORDER BY input_sort_columns ) → xml

  3. PostgreSQL 13 ← 12 手册重排

    这一跳手册重排了函数表的写法,签名文本整体改写,只记函数的增删,不逐条比较签名。

  4. PostgreSQL 9.2 ← 9.1 说明更新

    说明更新

签名矩阵

每条签名在给出了签名的 18 个版本里的存在情况;方格指向该版的签名。只在正文里提到此函数、没有给出签名的版本不列进来,上面的版本轨迹里仍然有它们。签名文本在 PostgreSQL 13 前后写法不同,跨越那一跳的同一条签名会显示成两行。

存在 不存在

签名 9.09.19.29.39.49.59.61011121314151617181920
xmlagg(xml) 存在 存在 存在 存在 存在 存在 存在 存在 存在 存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在
xmlagg ( expression ) → xml 存在 存在 存在 存在 存在 存在 存在 存在 存在 存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在
xmlagg ( xml ) → xml 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 存在 存在 存在 存在 存在 存在 存在 存在
xmlagg ( xml ORDER BY input_sort_columns ) → xml 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 不存在 存在 存在 存在 存在

同组函数

函数 签名 主签名 版本变动 最近变更
XML FUNCTIONS XML 函数 29 个
cursor_to_xml基线 1 cursor_to_xml ( cursor refcursor, count integer, nulls boolean, tableforest boolean, targetns text ) → xml
table_to_xml映射由参数table传递的命名表的内容。 现存
cursor_to_xmlschema基线 1 cursor_to_xmlschema ( cursor refcursor, nulls boolean, tableforest boolean, targetns text ) → xml
最重要的是相同的参数被传递来获得匹配的 XML 数据映射和 XML 模式文档。 现存
database_to_xml基线 1 database_to_xml ( nulls boolean, tableforest boolean, targetns text ) → xml
这些函数会忽略当前用户不可读的表。 现存
database_to_xml_and_xmlschema基线 1 database_to_xml_and_xmlschema ( nulls boolean, tableforest boolean, targetns text ) → xml
这些函数会忽略当前用户不可读的表。 现存
database_to_xmlschema基线 1 database_to_xmlschema ( nulls boolean, tableforest boolean, targetns text ) → xml
这些函数会忽略当前用户不可读的表。 现存
query_to_xml基线 1 query_to_xml ( query text, nulls boolean, tableforest boolean, targetns text ) → xml
table_to_xml映射由参数table传递的命名表的内容。 现存
query_to_xml_and_xmlschema基线 1 query_to_xml_and_xmlschema ( query text, nulls boolean, tableforest boolean, targetns text ) → xml
下面的函数产生 XML 数据映射和对应的 XML 模式,并把产生的结果链接在一起放在一个文档(或森林)中。 现存
query_to_xmlschema基线 1 query_to_xmlschema ( query text, nulls boolean, tableforest boolean, targetns text ) → xml
最重要的是相同的参数被传递来获得匹配的 XML 数据映射和 XML 模式文档。 现存
schema_to_xml基线 1 schema_to_xml ( schema name, nulls boolean, tableforest boolean, targetns text ) → xml
这些函数会忽略当前用户不可读的表。 现存
schema_to_xml_and_xmlschema基线 1 schema_to_xml_and_xmlschema ( schema name, nulls boolean, tableforest boolean, targetns text ) → xml
这些函数会忽略当前用户不可读的表。 现存
schema_to_xmlschema基线 1 schema_to_xmlschema ( schema name, nulls boolean, tableforest boolean, targetns text ) → xml
这些函数会忽略当前用户不可读的表。 现存
table_to_xml基线 1 table_to_xml ( table regclass, nulls boolean, tableforest boolean, targetns text ) → xml
table_to_xml映射由参数table传递的命名表的内容。 现存
table_to_xml_and_xmlschema基线 1 table_to_xml_and_xmlschema ( table regclass, nulls boolean, tableforest boolean, targetns text ) → xml
下面的函数产生 XML 数据映射和对应的 XML 模式,并把产生的结果链接在一起放在一个文档(或森林)中。 现存
table_to_xmlschema基线 1 table_to_xmlschema ( table regclass, nulls boolean, tableforest boolean, targetns text ) → xml
最重要的是相同的参数被传递来获得匹配的 XML 数据映射和 XML 模式文档。 现存
xml_is_well_formed 1 xml_is_well_formed ( text ) → boolean
这些函数检查一个text串是不是一个良构的 XML,返回一个布尔结果。 现存
xml_is_well_formed_content 1 xml_is_well_formed_content ( text ) → boolean
这些函数检查一个text串是不是一个良构的 XML,返回一个布尔结果。 现存
xml_is_well_formed_document 1 xml_is_well_formed_document ( text ) → boolean
这些函数检查一个text串是不是一个良构的 XML,返回一个布尔结果。 现存
xmlagg基线 2 xmlagg ( xml ) → xml 171 次
和这里描述的其他函数不同,函数xmlagg是一个聚合函数。 现存
xmlcomment基线 1 xmlcomment ( text ) → xml
函数xmlcomment创建了一个 XML 值,它包含一个使用指定文本作为内容的 XML 注释。 现存
xmlconcat基线 1 xmlconcat ( xml [, ...] ) → xml
函数xmlconcat将由单个 XML 值组成的列表串接成一个单独的值,这个值包含一个 XML 内容片断。 现存
xmlelement基线 1 xmlelement ( NAME name [, XMLATTRIBUTES ( attvalue [AS attname] [, ...] ) ] [, content [, ...]] ) → xml
表达式xmlelement使用给定名称、属性和内容产生一个 XML 元素。 现存
XMLEXISTS 1 XMLEXISTS ( text PASSING [BY {REF|VALUE}] xml [BY {REF|VALUE}] ) → boolean 121 次
函数xmlexists评价一个XPath 1.0表达式(第一个参数),以传递的XML值作为其上下文项。 现存
xmlforest基线 1 xmlforest ( content [AS name] [, ...] ) → xml
表达式xmlforest使用给定名称和内容产生一个元素的 XML 森林(序列)。 现存
xmlpi基线 1 xmlpi ( NAME name [, content] ) → xml
表达式xmlpi创建一个 XML 处理指令。 现存
xmlroot基线 1 xmlroot ( xml, VERSION {text|NO VALUE} [, STANDALONE {YES|NO|NO VALUE} ] ) → xml
表达式xmlroot修改一个 XML 值的根结点的属性。 现存
XMLTABLE 1 XMLTABLE ( [XMLNAMESPACES ( namespace_uri AS namespace_name [, ...] ), ] row_expression PASSING [BY {REF|VALUE}] document_expression [BY {REF|VALUE}] COLUMNS name { type [PATH column_expression] [DEFAULT default_expression] [NOT NULL | NULL] | FOR ORDINALITY } [, ...] ) → setof record 121 次
xmltable表达式基于给定的XML值产生一个表、一个抽取行的XPath过滤器以及一个列定义集合。 现存
xmltext 1 xmltext ( text ) → xml
函数 xmltext 返回一个只包含单个文本节点的 XML 值,该文本节点的内容就是输入参数。 现存
xpath基线 1 xpath ( xpath text, xml xml [, nsarray text[]] ) → xml[] 9.11 次
函数xpath根据 XML 值xml计算 XPath 1.0 表达式xpath (以文本形式给出)。 现存
xpath_exists 1 xpath_exists ( xpath text, xml xml [, nsarray text[]] ) → boolean
函数xpath_exists是xpath函数的一种特殊形式。 现存