ARRAY_CAT

Concatenates two arrays of the same element type.

If the inputs are both bounded, the bound for the result is the sum of the bounds of the inputs.

If any input is unbounded, the result is unbounded with a binary size that is the sum of the sizes of the inputs.

Behavior Type

Immutable

Syntax

ARRAY_CAT(array1,array2)

Arguments

array1, array2 Arrays of matching dimensionality and element type

Supported Data Types

Arrays of any dimensionality and element type, so long as dimensionality and element types are the same for both inputs. For example, ROW elements must have the same fields.

Null-Handling

If either input is NULL, the function returns NULL.

Examples

Types are coerced if necessary, as shown in the second example.

=> SELECT array_cat(ARRAY[1,2], ARRAY[3,4,5]);
array_cat
-----------------------
[1,2,3,4,5]
(1 row)

=> SELECT array_cat(ARRAY[1,2], ARRAY[3,4,5.0]);
array_cat
-----------------------
["1.0","2.0","3.0","4.0","5.0"]
(1 row)