According to documentation , /var/lib/pgsql/data
is the grouping data directory where the data required for a database pool, usually referenced as PGDATA , is stored, because of the name of the environment variable that can be used to define it. This directory contains multiple subdirectories and control files, such as pg_database
and postgresql.conf
.
The base subdirectory contains subdirectories per database, for each cluster database there is a subdirectory within PGDATA / base , with a name corresponding to OID database in pg_database
. This subdirectory is the default location for the database files, in particular, the database system catalogs are stored in this subdirectory. Each table and index is stored in a separate file, with a name corresponding to the filenode number of the table or index, which can be found at pg_class.relfilenode
.
When a table or index exceeds 1Gb, it is divided into segments up to 1Gb. The first segment file name is the same as the filenode , subsequent files are called filenode.1 , filenode.2 , for example 17614.1 . This organization avoids problems on platforms that have file size limitation.