Using STRING_TO_TABLE() in PostgreSQL

In PostgreSQL, we can use the string_to_table() function to return a set of rows, each containing a part of the string. The string is split based on the specified delimiter.

If we specify a null delimiter, then each character becomes a separate row in the output. If the delimiter string is empty, then the whole string is returned in a single row.

We also have the option of turning a specific substring into null if required.

Read more

How ARRAY_POSITION() Works in PostgreSQL

PostgreSQL has an array_position() function that returns the position of the first occurrence of a given value in an array.

We have the option to specify a starting position, so that the function returns the position of the first occurrence after that.

To get all occurrences, use array_positions() instead.

Read more

A Quick Overview of ARRAY_NDIMS() in PostgreSQL

In PostgreSQL the array_ndims() function returns the number of dimensions of an array. We pass the array to the function, and it returns an integer of the number of dimensions in the array.

This function is not to be confused with the array_dims() function, which returns a more detailed text representation of the dimensions in the array.

Read more

Understanding ARRAY_DIMS() in PostgreSQL

In PostgreSQL we can use the array_dims() function to return information about the dimensions in an array. The function accepts the array in question, and it returns a text representation of the array’s dimensions.

This function is not to be confused with the array_ndims() function, which simply returns the number of dimensions in an array.

Read more