According to the documentation, /var/lib/pgsql/data
is the grouping data directory where the data required for a grouping of databases is stored, usually referred to as PGDATA, due to the name of the environment variable that can be used to define it. This directory contains several subdirectories and control files, such as the pg_database
and postgresql.conf
.
The Subdirectory groundwork contains subdirectories per database, for each database of the grouping there is a subdirectory within PGDATA/basis, with the name corresponding to OID of the 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 name corresponding to the number of the filenode table or index, which can be found in pg_class.relfilenode
.
When a table or index exceeds 1Gb, it is divided into segments up to 1 Gb. The name of the first segment file 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.
Thank you very much Qmechanic73 .
– Bruno Menezes