I have a table with array values.
create table A (v int[]);
insert into A (v) values ('{1,2,3}');
insert into A (v) values ('{}');
insert into A (v) values (NULL);
insert into A (v) values ('{4,5}');
And table for aggregating this values
create table B (v int[][]);
I need insert all rows from a to b so b.v should be
{{123},{},{},{4,5}}
How you see, also I need map null to empty array. I tired something like
insert into B (v)
select array_agg(v) from A
But it's not worked - Can't aggreate empty or null values.