I have a hierarchical data set where parent nodes would have attributes x and y, while the leaf nodes would have attribute z. In simpler terms, my tree structure would look as follows:
ROOT
/ \
[x,y] Node 1 [x,y] Node 2
/ \ \
[x,y] Node 1.1 [z] Node 1.2 [z] Node 2.1
/
[z] Node 1.1.1
I need to store this in a database, but I am not sure how. I found the following post about how to store a tree structure in a DB, but I don't see how I can use either of them to also store the attributes of each node. Any tips would be most welcome. I am using PostgreSql.