↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 函数

trim

从string的开始、末端或两端(默认为BOTH)移除仅包含characters(默认为空格)字符的最长字符串。

英文手册覆盖始于 PostgreSQL 7.1. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 18·选择有来源记录的版本

group
string
group label
String Functions And Operators
lang
en
layout
table-new
pages
functions-string.html, functions-binarystring.html
prose only
false
zh from
未知

版本定义 PG 18

从string的开始、末端或两端(默认为BOTH)移除仅包含characters(默认为空格)字符的最长字符串。
trim ( [ LEADING | TRAILING | BOTH ] [ characters text ] FROM string text ) → text
从string的开始、末端或两端(默认为BOTH)移除仅包含characters(默认为空格)字符的最长字符串。
trim ( [ LEADING | TRAILING | BOTH ] [ FROM ] string text [, characters text ] ) → text
这是一个非标准的trim()语法。
trim ( [ LEADING | TRAILING | BOTH ] bytesremoved bytea FROM bytes bytea ) → bytea
从bytes的开头、结尾或两端(默认为BOTH)移除仅由bytesremoved中字节组成的最长字符串。
trim ( [ LEADING | TRAILING | BOTH ] [ FROM ] bytes bytea, bytesremoved bytea ) → bytea
这是一个非标准的trim()语法。

函数签名与重载

trim ( [ LEADING | TRAILING | BOTH ] [ characters text ] FROM string text ) → text → text
从string的开始、末端或两端(默认为BOTH)移除仅包含characters(默认为空格)字符的最长字符串。
trim ( [ LEADING | TRAILING | BOTH ] [ FROM ] string text [, characters text ] ) → text → text
这是一个非标准的trim()语法。
trim ( [ LEADING | TRAILING | BOTH ] bytesremoved bytea FROM bytes bytea ) → bytea → bytea
从bytes的开头、结尾或两端(默认为BOTH)移除仅由bytesremoved中字节组成的最长字符串。
trim ( [ LEADING | TRAILING | BOTH ] [ FROM ] bytes bytea, bytesremoved bytea ) → bytea → bytea
这是一个非标准的trim()语法。

比较版本

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · b7bd9cda

正文语言: zh-Hans · 1b5ca64c