↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Storage Structures

Storage Structures

Compare versions

Database files, relation forks, pages, tuples, TOAST, free-space and visibility maps.

Reading PostgreSQL 18.6.

35 entries; 35 recorded in PostgreSQL 18.6.

  • PG_VERSION PGDATA paths

    A file containing the major version number of PostgreSQL

  • base PGDATA paths

    Subdirectory containing per-database subdirectories

  • current_logfiles PGDATA paths

    File recording the log file(s) currently written to by the logging collector

  • global PGDATA paths

    Subdirectory containing cluster-wide tables, such as pg_database

  • pg_commit_ts PGDATA paths

    Subdirectory containing transaction commit timestamp data

  • pg_dynshmem PGDATA paths

    Subdirectory containing files used by the dynamic shared memory subsystem

  • pg_logical PGDATA paths

    Subdirectory containing status data for logical decoding

  • pg_multixact PGDATA paths

    Subdirectory containing multitransaction status data (used for shared row locks)

  • pg_notify PGDATA paths

    Subdirectory containing LISTEN/NOTIFY status data

  • pg_replslot PGDATA paths

    Subdirectory containing replication slot data

  • pg_serial PGDATA paths

    Subdirectory containing information about committed serializable transactions

  • pg_snapshots PGDATA paths

    Subdirectory containing exported snapshots

  • pg_stat PGDATA paths

    Subdirectory containing permanent files for the statistics subsystem

  • pg_stat_tmp PGDATA paths

    Subdirectory containing temporary files for the statistics subsystem

  • pg_subtrans PGDATA paths

    Subdirectory containing subtransaction status data

  • pg_tblspc PGDATA paths

    Subdirectory containing symbolic links to tablespaces

  • pg_twophase PGDATA paths

    Subdirectory containing state files for prepared transactions

  • pg_wal PGDATA paths

    Subdirectory containing WAL (Write Ahead Log) files

  • pg_xact PGDATA paths

    Subdirectory containing transaction commit status data

  • postgresql.auto.conf PGDATA paths

    A file used for storing configuration parameters that are set by ALTER SYSTEM

  • postmaster.opts PGDATA paths

    A file recording the command-line options the server was last started with

  • postmaster.pid PGDATA paths

    A lock file recording the current postmaster process ID (PID), cluster data directory path, postmaster start timestamp, port number, Unix-domain socket directory path (could be empty), first valid listen_address (IP address or * , or empty if not li…

  • Database File Layout Physical structures

    This section describes the storage format at the level of files and directories.

  • Database Page Layout Physical structures

    This section provides an overview of the page format used within PostgreSQL tables and indexes. [19] Sequences and TOAST tables are formatted just like a regular table.

  • Free Space Map Physical structures

    Each heap and index relation, except for hash indexes, has a Free Space Map ( FSM ) to keep track of available space in the relation. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the re…

  • Heap-Only Tuples ( HOT ) Physical structures

    To allow for high concurrency, PostgreSQL uses multiversion concurrency control ( MVCC ) to store rows. However, MVCC has some downsides for update queries. Specifically, updates require new versions of rows to be added to tables. This can also requ…

  • TOAST Physical structures

    This section provides an overview of TOAST (The Oversized-Attribute Storage Technique).

  • Table row layout Physical structures

    Physical row headers, null bitmap, alignment and column data.

  • The Initialization Fork Physical structures

    Each unlogged table, and each index on an unlogged table, has an initialization fork. The initialization fork is an empty table or index of the appropriate type. When an unlogged table must be reset to empty due to a crash, the initialization fork i…

  • Visibility Map Physical structures

    Each heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. It's stored alongside the main rela…

  • WAL Internals Physical structures

    WAL is automatically enabled; no action is required from the administrator except ensuring that the disk-space requirements for the WAL files are met, and that any necessary tuning is done (see Section 28.5 ).

  • fsm fork Relation forks

    Each table and index is stored in a separate file. For ordinary relations, these files are named after the table or index's filenode number, which can be found in pg_class . relfilenode . But for temporary relations, the file name is of the form t B…

  • init fork Relation forks

    Each table and index is stored in a separate file. For ordinary relations, these files are named after the table or index's filenode number, which can be found in pg_class . relfilenode . But for temporary relations, the file name is of the form t B…

  • main fork Relation forks

    Each table and index is stored in a separate file. For ordinary relations, these files are named after the table or index's filenode number, which can be found in pg_class . relfilenode . But for temporary relations, the file name is of the form t B…

  • vm fork Relation forks

    Each table and index is stored in a separate file. For ordinary relations, these files are named after the table or index's filenode number, which can be found in pg_class . relfilenode . But for temporary relations, the file name is of the form t B…

RecordedFirst recordedInterface or attribute changeNo longer recorded

Squares indicate presence in sampled builds, not first introduction. Select a square for the same-version definition and sources.

Changes in PostgreSQL 18.6 · Export JSON

Reading this collection

The inventory covers documented physical structures and PGDATA paths, not every internal C struct. Page size, alignment and access-method-specific layouts depend on the build; diagrams are conceptual.