PostgreSQL – Aggregate attributes from different columns recursively
id_start id_end 1 2 2 3 3 4 I want to collect elements who are "connected" like [1, 2, 3, 4]. (in an array for example) I tried a recursive query like: WITH RECURSIVE q_rec AS ( SELECT id_start, id_end…