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: | 113 |
Nodes: | 8 (1 / 7) |
Uptime: | 156:03:50 |
Calls: | 2,504 |
Calls today: | 1 |
Files: | 8,703 |
Messages: | 1,929,840 |