Character Processing Functions and Operators
String functions and operators provided by GaussDB are for concatenating strings with each other, concatenating strings with non-strings, and matching the patterns of strings. Note: Except length-related functions, other functions and operators of string processing functions do not support parameters greater than 1 GB.

- For a string containing linefeed characters, for example, a string consisting of a linefeed character and a space, the value of LENGTH and LENGTHB in GaussDB is 2.
- In GaussDB, n in the CHAR(n) type indicates the number of characters. Therefore, for multiple-octet coded character sets, the length returned by the LENGTHB function may be longer than n.
- GaussDB supports multiple types of databases, including A-, B-, C-, and PG-compatible. If the database type is not specified, A-compatible mode is used by default for GaussDB. The lexical analyzer of A-compatible database is different from that of the other three databases. In A-compatible database, an empty character string is considered as NULL. Therefore, when a type A database is used, if an empty string is used as a parameter in the preceding character operation function, no output is displayed. For example:
gaussdb=# SELECT translate('12345','123',''); translate ----------- (1 row)
This is because the kernel checks whether the input parameter contains NULL before calling the corresponding function. If the input parameter contains NULL, the kernel does not call the corresponding function. As a result, no output is displayed. In PG-compatible mode, the processing of character strings is the same as that of PG. Therefore, the preceding problem does not occur.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot