Trapped on a plane waiting to take off and reading the #postgres docs. We built half the good stuff in @metaplane with recursive queries (https://www.postgresql.org/docs/current/queries-with.html#QUERIES-WITH-RECURSIVE), but there are deeper bits that I didn't know about.
The `UNION` takes care of cycles in a lot of cases, but there are examples of how to handle cycles manually when it doesn't... and again there's built-in cycle detection syntax too.
https://www.postgresql.org/docs/current/queries-with.html#QUERIES-WITH-CYCLE
