Conditionally insert a value in an array when creating a new column
array_remove() seems to answer my use case (by removing in a 2nd step the null values):
select array_remove(array[col -&gt; 0 -&gt;&gt; 'v', col-&gt; 1 -&gt;&gt; 'v'], null) from src