I have this PostgreSQL table with node of a directed graph:
node_id | node_sequence
-----------------------
1 1
2 2
3 3
I'd return a table with all the possible origin destination sequence (only in one direction) between the node: (1,2); (1,2,3); (2,3). So the output table should be:
node_id
----
1
2
1
2
3
2
3
Maybe WITH RECURSIVE is the right thing to do but I cannot understand how.