PostgreSQL Array Functions

This page lists array functions that help you to manipulate strings efficiently in PostgreSQL.

  1. array_append

    The PostgreSQL array_append() function appends the specified element to the end of the specified array and returns the modified array.
  2. array_cat

    The PostgreSQL array_cat() function concatenates two specified arrays into one array and returns the result array.
  3. array_dims

    The PostgreSQL array_dims() function returns a text representing the dimensions of the specified array.
  4. array_fill

    The PostgreSQL array_fill() function returns an array filled with the specified elements.
  5. array_length

    The PostgreSQL array_length() function returns the length of the specified array dimension.
  6. array_lower

    The PostgreSQL array_lower() function returns the starting subscript of a specified array dimension.
  7. array_ndims

    The PostgreSQL array_ndims() function returns the number of dimensions of the specified array.
  8. array_position

    The PostgreSQL array_position() function finds the specified element in a specified array and returns the subscript of the the first occurrence.
  9. array_positions

    The PostgreSQL array_positions() function finds the specified element in a specified array and returns subscripts of all occurrences as an array.
  10. array_prepend

    The PostgreSQL array_prepend() function prepends the specified element to the start of the specified array and returns the modified array.
  11. array_remove

    The PostgreSQL array_remove() function removes all specified elements from the specified array and returns the modified array.
  12. array_replace

    The PostgreSQL array_replace() function replaces the specified element with a new element in the specified array and returns the modified array.
  13. array_to_string

    The PostgreSQL array_to_string() function concatenates all elements in an array with a delimiter and returns the result.
  14. array_upper

    The PostgreSQL array_upper() function returns the maximum subscript of the specified array dimension.
  15. cardinality

    The PostgreSQL cardinality() function returns the total number of all elements in an array.
  16. trim_array

    The PostgreSQL trim_array() function removes the specified number of elements from the end of the specified array and returns the modified array.
  17. unnest

    The PostgreSQL unnest() function expands the specified array into a set of rows.