Understanding the organization of PostgreSQL database logical objects helps with the understanding of object relations and interactions. PostgreSQL databases, roles, tablespaces, settings, and template languages have the same level of hierarchy, as shown in the following diagram:
All objects in the hierarchy are explained in detail as follows.