Hello
select array_agg(distinct mycolumn) from
from the very beginning? Even the 7.1 manual describes such a syntax: https://www.postgresql.org/docs/7.1/sql-expressions.html
regards, Sergei