upper(text s) | text | Converts s to uppercase. |
lower(text s) | text | Converts s to lowercase. |
length(text s) | integer | Counts the number of characters in s. |
concat(expr x, y, …) | text | Concatenates the provided expressions. |
substr(expr s, numeric start, numeric numChars) | text | Returns a substring of s from start to a max of numChars, if provided. start is a 1-based index, so substr('hello', 2) returns 'ello' . If the start is less than 1, it is treated as if it were 1. The result is computed by taking the range of characters [start, start+numChars] , where if any value is less than 1, it is treated as 1. This means substr('hello', -2, 4) returns 'h' . |
replace(text s, text from, text to) | text | Replaces all occurrences in s of substring from with substring to. |
regexp_replace(text s, text pattern, text replacement) | text | Replace substrings in s that match the POSIX regular expression pattern with the replacement. Supports Go’s regular expression syntax. |
reverse(expr text) | string | Reverses the string (brown → nworb). |
md5(expr text) | string | Calculates the MD5 hash of a string and returns the result in hexadecimal. |
char_length(str text) | integer | Returns number of characters in str. |
left(str text, n int) | text | Returns first n characters in str. When n is negative, return all but last |n| characters. |
right(str text, n int) | text | Returns last n characters in str. When n is negative, return all but first |n| characters. |
ltrim(str text [, characters text]) | text | Removes the longest string containing only characters from characters (a space by default) from the start of str. |
rtrim(str text [, characters text]) | text | Removes the longest string containing only characters from characters (a space by default) from the end of str |
trim([leading | trailing | both] [characters] from str) | text | Removes the longest string containing only the characters (a space by default) from the start/end/both ends of str. |
sort_order_ip(ip text) | text | Returns a string representing a sort order over IPv4 and IPv6 range. |