pg_ls_waldir()

A system function for examining the contents of the pg_wal directory

pg_ls_waldir() is a system function for examining the contents of the pg_wal directory.

pg_ls_waldir() was added in PostgreSQL 10.

Usage

pg_ls_waldir() returns a list of all files in the pg_wal 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_waldir() ORDER BY name;
           name           |   size   |      modification      
--------------------------+----------+------------------------
 000000010000000000000001 | 16777216 | 2020-11-06 10:25:35+01
 000000010000000000000002 | 16777216 | 2020-11-06 10:25:35+01
 000000010000000000000003 | 16777216 | 2020-11-06 10:26:15+01
 000000010000000000000004 | 16777216 | 2020-11-06 10:35:45+01
(4 rows)

Categories

Data directory, System function, WAL

See also

pg_ls_archive_statusdir()