Tagged Questions
0
votes
2answers
98 views
Performing SELECT on EACH ROW in CTE or Nested QUERY?
This is a problem in PostgreSQL
I have a table which stores the tree of users;
+------+---------+
| id | parent |
|------+---------|
| 1 | 0 |
|------|---------|
...
2
votes
1answer
864 views
PostgreSQL tree structure and recursive CTE optimization
I'm trying to represent a tree structure in PostgreSQL (8.4) to be able to query the path from the root to a given node or to find all the nodes within a sub-branch.
Here is a test table:
CREATE ...