pg_stat_archiver

A statistics view showing information about WAL archiving status via the archive_command parameter

pg_stat_archiver is a statistics view view showing information about the status of WAL files archived via the archive_command parameter, including times of the last successful and failed archive attempts.

pg_stat_archiver was added in PostgreSQL 9.4.

Definition by PostgreSQL version

pg_stat_archiver (PostgreSQL 13)

                       View "pg_catalog.pg_stat_archiver"
       Column       |           Type           | Collation | Nullable | Default
--------------------+--------------------------+-----------+----------+---------
 archived_count     | bigint                   |           |          |
 last_archived_wal  | text                     |           |          |
 last_archived_time | timestamp with time zone |           |          |
 failed_count       | bigint                   |           |          |
 last_failed_wal    | text                     |           |          |
 last_failed_time   | timestamp with time zone |           |          |
 stats_reset        | timestamp with time zone |           |          |
    

Documentation: pg_stat_archiver

pg_stat_archiver (PostgreSQL 12)

                       View "pg_catalog.pg_stat_archiver"
       Column       |           Type           | Collation | Nullable | Default
--------------------+--------------------------+-----------+----------+---------
 archived_count     | bigint                   |           |          |
 last_archived_wal  | text                     |           |          |
 last_archived_time | timestamp with time zone |           |          |
 failed_count       | bigint                   |           |          |
 last_failed_wal    | text                     |           |          |
 last_failed_time   | timestamp with time zone |           |          |
 stats_reset        | timestamp with time zone |           |          |
    

Documentation: pg_stat_archiver

pg_stat_archiver (PostgreSQL 11)

                       View "pg_catalog.pg_stat_archiver"
       Column       |           Type           | Collation | Nullable | Default
--------------------+--------------------------+-----------+----------+---------
 archived_count     | bigint                   |           |          |
 last_archived_wal  | text                     |           |          |
 last_archived_time | timestamp with time zone |           |          |
 failed_count       | bigint                   |           |          |
 last_failed_wal    | text                     |           |          |
 last_failed_time   | timestamp with time zone |           |          |
 stats_reset        | timestamp with time zone |           |          |
    

Documentation: pg_stat_archiver

pg_stat_archiver (PostgreSQL 10)

                       View "pg_catalog.pg_stat_archiver"
       Column       |           Type           | Collation | Nullable | Default
--------------------+--------------------------+-----------+----------+---------
 archived_count     | bigint                   |           |          |
 last_archived_wal  | text                     |           |          |
 last_archived_time | timestamp with time zone |           |          |
 failed_count       | bigint                   |           |          |
 last_failed_wal    | text                     |           |          |
 last_failed_time   | timestamp with time zone |           |          |
 stats_reset        | timestamp with time zone |           |          |
    

Documentation: pg_stat_archiver

pg_stat_archiver (PostgreSQL 9.6)

            View "pg_catalog.pg_stat_archiver"
       Column       |           Type           | Modifiers
--------------------+--------------------------+-----------
 archived_count     | bigint                   |
 last_archived_wal  | text                     |
 last_archived_time | timestamp with time zone |
 failed_count       | bigint                   |
 last_failed_wal    | text                     |
 last_failed_time   | timestamp with time zone |
 stats_reset        | timestamp with time zone |
    

Documentation: pg_stat_archiver

pg_stat_archiver (PostgreSQL 9.5)

            View "pg_catalog.pg_stat_archiver"
       Column       |           Type           | Modifiers
--------------------+--------------------------+-----------
 archived_count     | bigint                   |
 last_archived_wal  | text                     |
 last_archived_time | timestamp with time zone |
 failed_count       | bigint                   |
 last_failed_wal    | text                     |
 last_failed_time   | timestamp with time zone |
 stats_reset        | timestamp with time zone |
    

Documentation: pg_stat_archiver

pg_stat_archiver (PostgreSQL 9.4)

            View "pg_catalog.pg_stat_archiver"
       Column       |           Type           | Modifiers
--------------------+--------------------------+-----------
 archived_count     | bigint                   |
 last_archived_wal  | text                     |
 last_archived_time | timestamp with time zone |
 failed_count       | bigint                   |
 last_failed_wal    | text                     |
 last_failed_time   | timestamp with time zone |
 stats_reset        | timestamp with time zone |
    

Documentation: pg_stat_archiver

Change history

This view has not been modified since it was introduced in PostgreSQL 9.4.

Examples

postgres=# SELECT * FROM pg_stat_archiver\x\g\x
Expanded display is on.
-[ RECORD 1 ]------+------------------------------
archived_count     | 0
last_archived_wal  | 
last_archived_time | 
failed_count       | 135
last_failed_wal    | 000000010000000000000001
last_failed_time   | 2019-06-10 22:34:09.730097+02
stats_reset        | 2019-06-10 21:50:35.053854+02

Categories

Backup, Replication, Statistics / monitoring view, WAL

See also

pg_stat_replication, archive_mode, archive_command, pg_ls_archive_statusdir()