postgresql_16:4.13.2.12 pg_stat_archiver
PostgreSQL 16 > Server Administration > Monitoring Database Activity > The Cumulative Statistics System > pg_stat_archiver
The pg_stat_archiver view will always have a single row, containing data about the archiver process of the cluster.
| Column Type Description | | --- | | archived_count bigint Number of WAL files that have been successfully archived | | last_archived_wal text Name of the WAL file most recently successfully archived | | last_archived_time timestamp with time zone Time of the most recent successful archive operation | | failed_count bigint Number of failed attempts for archiving WAL files | | last_failed_wal text Name of the WAL file of the most recent failed archival operation | | last_failed_time timestamp with time zone Time of the most recent failed archival operation | | stats_reset timestamp with time zone Time at which these statistics were last reset |
Normally, WAL files are archived in order, oldest to newest, but that is not guaranteed, and does not hold under special circumstances like when promoting a standby or after crash recovery. Therefore it is not safe to assume that all files older than last_archived_wal have also been successfully archived.