In PostgreSQL, string_to_array()
is a string function that allows us to create an array from a string. It splits the string based on the specified delimiter and returns a text
array as a result.
If we specify a null delimiter, then each character becomes an element in the array. If the delimiter string is empty, then the whole string becomes a single element in the array.
We also have the option of turning a specific substring into null
if required.