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.
lordluke80@gmail.com 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: | 286 |
Nodes: | 16 (2 / 14) |
Uptime: | 85:27:18 |
Calls: | 6,495 |
Calls today: | 6 |
Files: | 12,099 |
Messages: | 5,276,973 |