SELECT tb.*, array_agg(conn.child_id), array_agg(conn.kind)
Create a custom type (using row(...) might work...?) with the relevant fields and “...array_agg((child_id, kind)::custom_type order by ...”?
David J.
SELECT tb.*, array_agg(conn.child_id), array_agg(conn.kind)