Database disk layout
In order to fully interpret the information returned by utilities such as pg_buffer_cache, and therefore use that information to adjust memory sizing, it's helpful to know a bit about how databases are stored on disk. On Unix-like systems, typically, the $PGDATA environment variable on your system will point to your database cluster and, underneath the base/ directory, actually contains the database tables.
If you're not sure where your database is located on disk, but if you can connect to the database, the location of this and other important files on the server is available from the pg_settings view. This particular detail is in the data_directory setting; here's an example of locating it, and a query showing the locations ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access