Array distinct. Array_agg postgresql примеры. id serial primary key. postgresql select join. order by postgresql.