Skip to content

Tag Archives: PostgreSQL-String-function

In PostgreSQL, the substring function is used to extract a substring from a string. Syntax: SUBSTRING ( string, start_position, length ) Let’s analyze the above… Read More
The PostgreSQL SPLIT_PART() function is used to split a string from a specific delimiter and these queries return the nth substring. Syntax: SPLIT_PART(string, delimiter, position)… Read More
The PostgreSQL RIGHT() function is used to query for the last n characters in a string. Syntax: RIGHT(string, n) Let’s analyze the above syntax: The… Read More
In PostgreSQL, the REPLACE function is used to search and replace all occurrences of a string with a new one. Syntax: REPLACE(source, old_text, new_text );… Read More
The PostgreSQL REGEXP_MATCHES() function is used to match a POSIX regular expression against a string and subsequently returns the strings that match the pattern. Syntax:REGEXP_MATCHES(source_string,… Read More
In PostgreSQL, the CONCAT_WS function is used to concatenate strings with a separator. Like the CONCAT function, the CONCAT_WS function is also variadic and ignored… Read More
In PostgreSQL, the CONCAT function is used to concatenate two or more strings into one. Syntax: CONCAT(string_1, string_2, ...) Let’s analyze the above syntax: The… Read More
The PostgreSQL CHR() function is used to convert an integer ASCII code to a character or a Unicode code point to a UTF8 character. Syntax:… Read More
The PostgreSQL ASCII() function is used to derive an an ASCII character. In the case of UTF-8, the ASCII() function returns the Unicode code point… Read More
The PostgreSQL POSITION() function returns the location of a substring in a string. Syntax: POSITION(substring in string) Let’s analyze the above syntax: The substring argument… Read More
The PostgreSQL MD5() function is used to evaluate the MD5 hash of a string and subsequently return the result. The result is generally in hexadecimal form.… Read More
In PostgreSQL, the TRIM() function is used to remove the longest string consisting of spaces or any specified character from a string. By default, the… Read More
The PostgreSQL LPAD() function is used for padding a string to the left by a specified length with other specified characters. Syntax: LPAD(string, length[, fill])… Read More
In PostgreSQL, the UPPER function is used to convert a string into upper case. Syntax: UPPER(string_expression) Like the LOWER function, the UPPER function accepts a… Read More
In PostgreSQL, the LOWER function is used to convert a string, an expression, or values in a column to lower case. Syntax: LOWER(string or value… Read More