Both Oracle and Postgres have objects and collections. This allows you to build hierarchical structures.
Postgres unfortunately doesn't allow for recursive structures ;(
If you are interested in how to do it take a look here: https://blog.dsl-platform.com/postgres-bridge-between-worlds...