pg_stat_wal — PostgreSQL statistics view

The PostgreSQL pg_stat_wal statistics view: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

The pg_stat_wal view will always have a single row, containing data about WAL activity of the cluster.

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_stat_wal statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • wal_records bigint
    Total number of WAL records generated
  • wal_fpi bigint
    Total number of WAL full page images generated
  • wal_bytes numeric
    Total amount of WAL generated in bytes
  • wal_fpi_bytes numeric
    Total amount of WAL full page images in bytes
  • wal_buffers_full bigint
    Number of times WAL data was written to disk because WAL buffers became full
  • stats_reset timestamp with time zone
    Time at which these statistics were last reset

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_stat_wal.