Add 0 into array_agg if there is no matching data
For the first point, you can try this:

COALESCE(array_agg(DISTINCT pr.position), '{0}'::integer[])


The same can be achieved by a CASE, too:

CASE WHEN array_agg(id) IS NULL
     THEN '{0}'::integer[] 
     ELSE array_agg(id) END


The second problem can be handled by a HAVING cause:

...
GROUP BY ...
HAVING array_length(COALESCE(array_agg(DISTINCT pr.position), '{0}'::integer[]), 1) &gt; 1;