10 ms·
You’d use these [0] functions to build a json string and return your structure, one row per root of each hierarchy (you might only return one row if you’re afte
by jklehm 10y ago
You’d use these [0] functions to build a json string and return your structure, one row per root of each hierarchy (you might only return one row if you’re after a single hierarchical json object).
[0] https://www.postgresql.org/docs/9.5/static/functions-json.html https://www.postgresql.org/docs/9.5/static/functions-json.ht...
- ruslan_talpa 10y agoPlease read the whole thread, this is the exact point i was making, json is the only way to return tree like data. willglynn was saying you can do it with "with recursive" and i think he was confusing "traversing/inspecting" tree like data with "returning" tree like data.