Pavel, Sergei,
> SELECT array_agg(DISTINCT ...) doesn't help?
It works, many thanks!
-- Best regards,Aleksander Alekseev