Any suggestion to achieve that or snippets about how to do that? havent foud any valid example for 'rebuild a tree in postgres' in the official docs.
[email protected] writes:
Any suggestion to achieve that or snippets about how to do that? havent foud any valid example for 'rebuild a tree in postgres' in the official docs.
Have a look at WITH RECURSIVE:
https://www.postgresql.org/docs/current/static/queries-with.html
https://tapoueh.org/blog/2018/01/exporting-a-hierarchy-in-json-with-recursive-queries/
Regards,
--
Dimitri Fontaine
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 08:31:56 |
| Calls: | 12,100 |
| Files: | 15,003 |
| Messages: | 6,517,955 |