mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Add pg_ls_archive_statusdir function
This function lists the contents of the WAL archive status directory, and is intended to be used by monitoring tools. Unlike pg_ls_dir(), access to it can be granted to non-superusers so that those monitoring tools can observe the principle of least privilege. Access is also given by default to members of pg_monitor. Author: Christoph Moench-Tegeder Reviewed-by: Aya Iwata Discussion: https://postgr.es/m/20180930205920.GA64534@elch.exwg.net
This commit is contained in:
@ -658,3 +658,12 @@ pg_ls_tmpdir_1arg(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return pg_ls_tmpdir(fcinfo, PG_GETARG_OID(0));
|
||||
}
|
||||
|
||||
/*
|
||||
* Function to return the list of files in the WAL archive status directory.
|
||||
*/
|
||||
Datum
|
||||
pg_ls_archive_statusdir(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return pg_ls_dir_files(fcinfo, XLOGDIR "/archive_status", true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user