I know this is not directly related but I've been looking at cms design lately and I was wondering what different approaches people have come across to store documents and content in a structured, hierarchical way? And if there is an accepted 'best' way of doing it.
From what I find documents are mostly in a table, and hierarchy is provided by another one, like a `categories` table, in which a `parent_id` column is used to refer to itself and form a tree. It helps a lot to cache that tree, as it usually is often used, not too big, rarely changes, and needs more then one query (mostly).
In Postgress there is the `ltree` extension, but then the solution is Pg specific.