pg_ls_archive_statusdir()

A system function for examining the contents of the WAL archive status directory

pg_ls_archive_statusdir() is a system function for examining the contents of the WAL archive status directory (pg_wal/archive_status).

pg_ls_archive_statusdir() was added in PostgreSQL 12.

Usage

pg_ls_archive_statusdir() returns a list of all files in the pg_wal/archive_status directory together with their size and modification timestamp.

Note that the rows are not returned in any particular order, so it may be useful to add an explicit sort criteria.

Change history

Examples

postgres=# SELECT * FROM pg_ls_archive_statusdir() ORDER BY name;
                     name                      | size |      modification      
-----------------------------------------------+------+------------------------
 000000010000000000000001.done                 |    0 | 2020-11-12 12:51:00+01
 000000010000000000000002.00000028.backup.done |    0 | 2020-11-12 12:51:01+01
 000000010000000000000002.done                 |    0 | 2020-11-12 12:51:01+01
 000000010000000000000003.done                 |    0 | 2020-11-12 12:52:15+01
 000000010000000000000004.ready                |    0 | 2020-11-12 12:54:58+01
(5 rows)

Categories

Data directory, WAL

See also

pg_ls_waldir(), pg_stat_archiver