By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
7 rows affected
id | parent_id | depth | _path |
---|---|---|---|
1 | 1 | 0 | /1 |
3 | 1 | 1 | /1/3 |
4 | 3 | 2 | /1/3/4 |
7 | 3 | 2 | /1/3/7 |
7 rows affected
id | parent_id | depth | _path |
---|---|---|---|
1 | 1 | 0 | /1 |
3 | 1 | 1 | /1/3 |
4 | 3 | 2 | /1/3/4 |
7 | 3 | 2 | /1/3/7 |