I’d approach this with the array operator.
select array(select unnest(:arr1) except select unnest(:arr2));
If :arr1 and :arr2 don’t intersect, using array_agg() leads to a null.
I’d approach this with the array operator.
select array(select unnest(:arr1) except select unnest(:arr2));
If :arr1 and :arr2 don’t intersect, using array_agg() leads to a null.