Hologres is compatible with PostgreSQL and allows you to use the standard PostgreSQL syntax for data development.

The following table describes the array functions that are supported by Hologres. Hologres supports a subset of PostgreSQL functions. For information about how to use the array functions, see Array Functions and Operators. The following table describes the array functions that Hologres supports.
Function Description Example Result
array_append(anyarray, anyelement) Appends an element to the end of an array. array_append(ARRAY[1,2], 3) {1,2,3}
array_cat(anyarray,anyarray) Concatenates two arrays. array_cat(ARRAY[1,2,3], ARRAY[4,5]) {1,2,3,4,5}
array_ndims(anyarray) Returns the number of dimensions of an array. array_ndims(ARRAY[[1,2,3], [4,5,6]]) 2
array_dims(anyarray) Returns a text representation of the dimensions of an array. array_dims(ARRAY[[1,2,3], [4,5,6]]) [1:2][1:3]
array_length(anyarray, int) Returns the length of the requested array dimension. array_length(ARRAY[1,2,3], 1) 3
array_lower(anyarray, int) Returns the lower bound of the requested array dimension. array_lower('[0:2]={1,2,3}'::int[], 1) 0
array_positions(anyarray, anyelement) Returns an array of subscripts of all occurrences of the second argument in the array given as the first argument. The array given as the first argument must be one-dimensional. array_positions(ARRAY['A','A','B','A'], 'A') {1,2,4}
array_prepend(anyelement, anyarray) Prepends an element to the start of an array. array_prepend(1, ARRAY[2,3]) {1,2,3}
array_remove(anyarray, anyelement) Removes all elements that are equal to the given value from an array. array_remove(ARRAY[1,2,3,2], 2) {1,3}
array_sort(anyarray) Sorts the elements in an array. If you specify an array of the TEXT type, this function converts the elements of the TEXT type into the INT8 type, sorts the elements of the INT8 type, and returns the sorted elements of the TEXT type in an array.
Note This function is supported by Hologres V1.1.46 and later.
array_sort(ARRAY['1','3','2','1']) {'1','1','2','3'}
array_to_string(anyarray,text[,text]) Concatenates array elements by using a specified delimiter and an optional null string. array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*') 1,2,3,*,5
array_upper(anyarray, int) Returns the upper bound of the requested array dimension. array_upper(ARRAY[1,8,3,7], 1) 4
unnest(anyarray) Expands an array to a set of rows. unnest(ARRAY[1,2])



(2 rows)