PostgreSQL - Common Table Expressions
Why does this recursive CTE cause an infinite loop?
Assuming the table has a cycle in parent-child links.
WITH RECURSIVE loop_cte AS ( SELECT id FROM items WHERE id = 1 UNION ALL SELECT i.id FROM items i JOIN loop_cte l ON i.parent_id = l.id ) SELECT * FROM loop_cte;
Assuming the table has a cycle in parent-child links.
