Concatenating the nested arrays {{1,2}}
and {{3,4}}
is no problem at all:
SELECT array_cat(
ARRAY[ARRAY[1,2]]
, ARRAY[ARRAY[3,4]]
)
array_cat
---------------
{{1,2},{3,4}}
But how to concatenate {{1,2}}
and {{3}}
in order to get {{1,2},{3}}
?
SELECT array_cat(
ARRAY[ARRAY[1,2]]
, ARRAY[ARRAY[3]]
)
psql: …: ERROR: cannot concatenate incompatible arrays
DETAIL: Arrays with differing element dimensions are not compatible
for concatenation.