Structure PostgreSQL 9.3 CentOS

3

I would like to know what is and what is part of this base directory.

  

/var/lib/pgsql/9.3/data/base/17500/18037

     

/var/lib/pgsql/9.3/data/base/17500/18170

     

/var/lib/pgsql/9.3/data/base/17500/18168

     

/var/lib/pgsql/9.3/data/base/17500/18169

     

/var/lib/pgsql/9.3/data/base/17500/17614.1

     

/var/lib/pgsql/9.3/data/base/17500/17614

    
asked by anonymous 29.01.2015 / 15:24

1 answer

2

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.

    
29.01.2015 / 16:04