1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add pg_ls_summariesdir().

This function returns the name, size, and last modification time of
each regular file in pg_wal/summaries.  This allows administrators
to grant privileges to view the contents of this directory without
granting privileges on pg_ls_dir(), which allows listing the
contents of many other directories.  This commit also gives the
pg_monitor predefined role EXECUTE privileges on the new
pg_ls_summariesdir() function.

Bumps catversion.

Author: Yushi Ogiwara
Reviewed-by: Michael Paquier, Fujii Masao
Discussion: https://postgr.es/m/a0a3af15a9b9daa107739eb45aa9a9bc%40oss.nttdata.com
This commit is contained in:
Nathan Bossart
2024-10-11 11:02:09 -05:00
parent add77755ce
commit 4e1fad3787
7 changed files with 51 additions and 1 deletions

View File

@ -689,6 +689,15 @@ pg_ls_archive_statusdir(PG_FUNCTION_ARGS)
return pg_ls_dir_files(fcinfo, XLOGDIR "/archive_status", true);
}
/*
* Function to return the list of files in the WAL summaries directory.
*/
Datum
pg_ls_summariesdir(PG_FUNCTION_ARGS)
{
return pg_ls_dir_files(fcinfo, XLOGDIR "/summaries", true);
}
/*
* Function to return the list of files in the PG_LOGICAL_SNAPSHOTS_DIR
* directory.