Contents
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 () → setof record (name
text
,size
bigint
,modification
timestamp with time zone
)
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
- PostgreSQL 10
- added (commit befd73c5)
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)
References
- PostgreSQL documentation: Generic File Access Functions