Reading the Internals of PostgreSQL: Database Cluster, Databases, and Tables
PostgreSQL organizes data into a database cluster (a server-managed directory). Within it, databases are subdirectories in the base folder, each holding system catalogs. Tables are stored as relation files (relfilenodes) inside their database's directory, located via OID mappings.
Background
A "database cluster" in PostgreSQL does not mean multiple servers — it is a single directory on disk where all databases managed by one PostgreSQL server instance live. Inside that cluster, databases are separate namespaces, and each database contains schemas (like folders) which hold tables, indexes, and other objects. The article walks through how these map to actual files and directories on the filesystem (e.g., each table's data lives in a file named by its OID, and large tables may spill into multiple "fork" files or numbered segments). It also explains hidden system schemas (pg_catalog, information_schema) and how tablespaces let administrators place data on different disks. This is core background for anyone who wants to understand PostgreSQL's storage architecture, backup strategies, or performance tuning at the OS level.