pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。
相对 PostgreSQL 8.2 的差异:8.3 共有 289 个函数、375 条签名。
「签名变化」指函数还在,但它的签名有增有删;只改说明文字不计入。「换了分组」指手册把这个函数挪到了另一页。
regexp_matches字符串函数和操作符
返回 POSIX 正则表达式 pattern 与 string 的第一次匹配中的子字符串;如果使用 g 标志,则返回所有匹配中的子字符串。参见第 9.7.3.1.6 节。
regexp_matches ( string text, pattern text [, flags text] ) → setof text[]
regexp_split_to_array字符串函数和操作符
使用 POSIX 正则表达式作为分隔符拆分 string,生成一个结果的数组;参见第 9.7.3.1.9 节。
regexp_split_to_array ( string text, pattern text [, flags text ] ) → text[]
regexp_split_to_table字符串函数和操作符
使用 POSIX 正则表达式作为分隔符拆分 string,生成一组结果;参见第 9.7.3.1.8 节。
regexp_split_to_table ( string text, pattern text [, flags text] ) → setof text
convert_from字符串函数和操作符
将表示编码 src_encoding 的文本的二进制字符串转换为数据库编码中的 text。(适用的转换请参阅第 23.3.4 节)。
convert_from ( string bytea, src_encoding name ) → text
convert_to字符串函数和操作符
将 text 字符串(数据库编码)转换为编码 dest_encoding 中编码的二进制字符串。(适用的转换请参阅第 23.3.4 节)。
convert_to ( string text, dest_encoding name ) → bytea
enum_first枚举支持函数
返回输入枚举类型的第一个值。
enum_first ( anyenum )
enum_last枚举支持函数
返回输入枚举类型的最后一个值。
enum_last ( anyenum )
enum_range枚举支持函数
将输入枚举类型的所有值作为一个有序的数组返回。
enum_range ( anyenum )
get_current_ts_config文本检索函数和操作符
返回当前默认文本检索配置的 OID(由 default_text_search_config 设置)。
get_current_ts_config ( ) → regconfig
numnode文本检索函数和操作符
返回 tsquery 中词位和操作符的数目。
numnode ( tsquery ) → integer
plainto_tsquery文本检索函数和操作符
将文本转换为 tsquery,根据指定的或默认配置对单词进行正规化。字符串中的任何标点符号都会被忽略(它们不决定查询操作符)。生成的查询匹配包含文本中所有非停用词的文档。
plainto_tsquery ( [ config regconfig , ] query text ) → tsquery
querytree文本检索函数和操作符
生成 tsquery 中可索引部分的表示。结果为空或仅为 T 表示该查询不可索引。
querytree ( query tsquery ) → text
setweight文本检索函数和操作符
将指定的 weight 赋给 vector 的每个元素。
setweight ( tsvector, "char" ) → tsvector
strip文本检索函数和操作符
从 tsvector 中移除位置和权重。
strip ( tsvector ) → tsvector
to_tsquery文本检索函数和操作符
将文本转换为 tsquery,根据指定的或默认配置对单词进行正规化。单词必须由有效的 tsquery 操作符组合。
to_tsquery ( [ config regconfig , ] query text ) → tsquery
to_tsvector文本检索函数和操作符
将文本转换为 tsvector,根据指定的或默认配置对单词进行正规化。结果中包含位置信息。
to_tsvector ( [ config regconfig , ] document text ) → tsvector
ts_debug文本检索函数和操作符
根据指定的或默认的文本检索配置从 document 中提取和正规化词元,并返回关于每个词元是如何处理的信息。详情参见第 12.8.1 节。
ts_debug ( [ config regconfig, ] document text, OUT alias text, OUT description text, OUT token text, OUT dictionaries regdictionary[], OUT dictionary regdictionary, OUT lexemes text[] ) → setof record
ts_headline文本检索函数和操作符
以缩略形式显示 query 在 document 中的匹配项;后者必须是原始文本,不能是 tsvector。在匹配查询之前,文档中的单词将根据指定的或默认配置进行正规化。第 12.3.4 节中讨论了该函数的使用,还描述了可用的 options。
ts_headline ( [ config regconfig, ] document text, query tsquery [, options text ] ) → text
ts_lexize文本检索函数和操作符
如果词典识别输入词元,则返回由替换词位组成的数组;如果词典识别该词元,但它是停用词,则返回空数组;如果词典无法识别该词元,则返回 NULL。详情参见第 12.8.3 节。
ts_lexize ( dict regdictionary, token text ) → text[]
ts_parse文本检索函数和操作符
使用指定名称的解析器从 document 中提取词元。详情参见第 12.8.2 节。
ts_parse ( parser_name text, document text, OUT tokid integer, OUT token text ) → setof record
ts_rank文本检索函数和操作符
计算一个分数,显示 vector 与 query 的匹配程度。详情请参见第 12.3.3 节。
ts_rank ( [ weights float4[], ] vector tsvector, query tsquery [, normalization integer ] ) → float4
ts_rank_cd文本检索函数和操作符
使用覆盖密度算法计算一个分数,显示 vector 与 query 的匹配程度。详情参见第 12.3.3 节。
ts_rank_cd ( [ weights float4[], ] vector tsvector, query tsquery [, normalization integer ] ) → float4
ts_rewrite文本检索函数和操作符
在 query 中使用 substitute 替换出现的 target。详情参见第 12.4.2.1 节。
ts_rewrite ( query tsquery, target tsquery, substitute tsquery ) → tsquery
ts_stat文本检索函数和操作符
执行 sqlquery,该查询必须返回单个 tsvector 列,并返回数据中每个不同词位的统计信息。详情参见第 12.4.4 节。
ts_stat ( sqlquery text, [ weights text, ] OUT word text, OUT ndoc integer, OUT nentry integer ) → setof record
ts_token_type文本检索函数和操作符
返回一个表,该表描述指定名称的解析器可以识别的每种类型的词元。详情参见第 12.8.2 节。
ts_token_type ( parser_name text, OUT tokid integer, OUT alias text, OUT description text ) → setof record
cursor_to_xmlXML 函数
下面的函数将会把关系表的内容映射成 XML 值。它们可以被看成是 XML 导出功能:
cursor_to_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, targetns text)
cursor_to_xmlschemaXML 函数
必须传入相同的参数,才能得到彼此匹配的 XML 数据映射和 XML 模式文档。
cursor_to_xmlschema(cursor refcursor, nulls boolean, tableforest boolean, targetns text)
database_to_xmlXML 函数
这些函数会忽略当前用户不可读的表。数据库范围的函数还会忽略当前用户没有 USAGE(查找)权限的模式。
database_to_xml(nulls boolean, tableforest boolean, targetns text)
database_to_xml_and_xmlschemaXML 函数
这些函数会忽略当前用户不可读的表。数据库范围的函数还会忽略当前用户没有 USAGE(查找)权限的模式。
database_to_xml_and_xmlschema(nulls boolean, tableforest boolean, targetns text)
database_to_xmlschemaXML 函数
这些函数会忽略当前用户不可读的表。数据库范围的函数还会忽略当前用户没有 USAGE(查找)权限的模式。
database_to_xmlschema(nulls boolean, tableforest boolean, targetns text)
query_to_xmlXML 函数
下面的函数将会把关系表的内容映射成 XML 值。它们可以被看成是 XML 导出功能:
query_to_xml(query text, nulls boolean, tableforest boolean, targetns text)
query_to_xml_and_xmlschemaXML 函数
下面的函数将会把关系表的内容映射成 XML 值。它们可以被看成是 XML 导出功能:
query_to_xml_and_xmlschema(query text, nulls boolean, tableforest boolean, targetns text)
query_to_xmlschemaXML 函数
必须传入相同的参数,才能得到彼此匹配的 XML 数据映射和 XML 模式文档。
query_to_xmlschema(query text, nulls boolean, tableforest boolean, targetns text)
schema_to_xmlXML 函数
这些函数会忽略当前用户不可读的表。数据库范围的函数还会忽略当前用户没有 USAGE(查找)权限的模式。
schema_to_xml(schema name, nulls boolean, tableforest boolean, targetns text)
schema_to_xml_and_xmlschemaXML 函数
这些函数会忽略当前用户不可读的表。数据库范围的函数还会忽略当前用户没有 USAGE(查找)权限的模式。
schema_to_xml_and_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text)
schema_to_xmlschemaXML 函数
这些函数会忽略当前用户不可读的表。数据库范围的函数还会忽略当前用户没有 USAGE(查找)权限的模式。
schema_to_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text)
table_to_xmlXML 函数
下面的函数将会把关系表的内容映射成 XML 值。它们可以被看成是 XML 导出功能:
table_to_xml(tbl regclass, nulls boolean, tableforest boolean, targetns text)
table_to_xml_and_xmlschemaXML 函数
下面的函数将会把关系表的内容映射成 XML 值。它们可以被看成是 XML 导出功能:
table_to_xml_and_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text)
table_to_xmlschemaXML 函数
必须传入相同的参数,才能得到彼此匹配的 XML 数据映射和 XML 模式文档。
table_to_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text)
xmlaggXML 函数
和这里描述的其他函数不同,函数 xmlagg 是一个聚合函数。它将聚合函数调用的输入值串接起来,非常像 xmlconcat 所做的事情,除了串接是跨行发生的而不是在单一行的多个表达式上发生。聚合函数的更多信息请见第 9.22 节。
xmlagg(xml)
xmlcommentXML 函数
函数 xmlcomment 创建了一个 XML 值,它包含一个使用指定文本作为内容的 XML 注释。该文本不能包含“--”,也不能以“-”结尾,否则该结果的结构不是一个合法的 XML 注释。如果参数为空,结果也为空。
xmlcomment(text)
xmlconcatXML 函数
函数 xmlconcat 将由各个独立 XML 值组成的列表串接成一个单独的值,这个值包含一个 XML 内容片段。空值会被忽略,只有当没有参数为非空时结果才为空。
xmlconcat(xml[, ...])
xmlelementXML 函数
表达式 xmlelement 使用给定名称、属性和内容产生一个 XML 元素。语法中显示的 name 和 attname 项是简单的标识符,而不是值。attvalue 和 content 项是表达式,它们可以产生任意 PostgreSQL 数据类型的值。XMLATTRIBUTES 的参数生成 XML 元素的属性;将 content 值连接起来形成其内容。
xmlelement(name name [, xmlattributes(value [AS attname] [, ... ])] [, content, ...])
xmlforestXML 函数
表达式 xmlforest 使用给定名称和内容产生由元素构成的 XML 森林(序列)。与 xmlelement 一样,每个 name 都必须是一个简单的标识符,而 content 表达式可以有任何数据类型。
xmlforest(content [AS name] [, ...])
xmlpiXML 函数
表达式 xmlpi 创建一个 XML 处理指令。与 xmlelement 一样,name 必须是一个简单的标识符,而 content 表达式可以有任何数据类型。如果存在,content 不能包含字符序列?>。
xmlpi(name target [, content])
xmlrootXML 函数
表达式 xmlroot 修改一个 XML 值的根节点的属性。如果指定了一个版本,它会替换根节点的版本声明中的值;如果指定了一个独立设置,它会替换根节点的独立声明中的值。
xmlroot(xml, version text|no value [, standalone yes|no|no value])
xpathXML 函数
函数 xpath 根据 XML 值 xml 计算 XPath 1.0 表达式 xpath(以文本形式给出)。它返回一个 XML 值的数组,该数组对应于该 XPath 表达式产生的节点集合。如果该 XPath 表达式返回一个标量值而不是一个节点集合,将会返回一个单一元素的数组。
xpath(xpath, xml[, nsarray])
pg_ts_config_is_visible系统信息函数和操作符
全文检索配置是否在搜索路径中可见?
pg_ts_config_is_visible ( config_oid ) → boolean
pg_ts_dict_is_visible系统信息函数和操作符
全文检索词典是否在搜索路径中可见?
pg_ts_dict_is_visible ( dict_oid ) → boolean
pg_ts_parser_is_visible系统信息函数和操作符
全文检索解析器是否在搜索路径中可见?
pg_ts_parser_is_visible ( parser_oid ) → boolean
pg_ts_template_is_visible系统信息函数和操作符
全文检索模板是否在搜索路径中可见?
pg_ts_template_is_visible ( template_oid ) → boolean
txid_current系统信息函数和操作符
参见 pg_current_xact_id()。
txid_current ( ) → bigint
txid_current_snapshot系统信息函数和操作符
参见 pg_current_snapshot()。
txid_current_snapshot ( ) → txid_snapshot
txid_snapshot_xip系统信息函数和操作符
参见 pg_snapshot_xip()。
txid_snapshot_xip ( txid_snapshot ) → setof bigint
txid_snapshot_xmax系统信息函数和操作符
参见 pg_snapshot_xmax()。
txid_snapshot_xmax ( txid_snapshot ) → bigint
txid_snapshot_xmin系统信息函数和操作符
参见 pg_snapshot_xmin()。
txid_snapshot_xmin ( txid_snapshot ) → bigint
txid_visible_in_snapshot系统信息函数和操作符
参见 pg_visible_in_snapshot()。
txid_visible_in_snapshot ( bigint, txid_snapshot ) → boolean
tsvector_update_trigger文本检索函数和操作符
根据关联的纯文本文档列自动更新 tsvector 列。所用的全文检索配置以名称形式指定为触发器参数。详见第 12.4.3 节。
tsvector_update_trigger ( ) → trigger
tsvector_update_trigger_column文本检索函数和操作符
根据关联的纯文本文档列自动更新 tsvector 列。所用的全文检索配置取自表的 regconfig 列。详见第 12.4.3 节。
tsvector_update_trigger_column ( ) → trigger
这一版没有移除函数。
| 函数 | 分组 | 增删 | 第一条新增签名 |
|---|---|---|---|
atan2 |
数学函数和操作符 | +1−1 | atan2 ( y, x ) |
setseed |
数学函数和操作符 | +1−1 | setseed ( dp ) → void |
width_bucket |
数学函数和操作符 | +1 | width_bucket ( op dp, b1 dp, b2 dp, count int ) → int |
length |
字符串函数和操作符 | +2 | length ( stringbytea, encoding name ) → int |
quote_ident |
字符串函数和操作符 | +1−1 | quote_ident ( string text ) → text |
quote_literal |
字符串函数和操作符 | +2−1 | quote_literal ( string text ) → text |
regexp_replace |
字符串函数和操作符 | +1−1 | regexp_replace ( string text, pattern text, replacement text [, flags text] ) → text |
convert |
字符串函数和操作符 | +1−2 | convert ( string bytea, src_encoding name, dest_encoding name ) → bytea |
path |
几何函数和操作符 | +1−1 | path ( polygon ) → path |
这一版没有函数换分组。