role and may be granted to other non-superuser roles.
+ |
+
+ pg_ls_archive_statusdir()
+
+ setof record
+
+ List the name, size, and last modification time of files in the WAL
+ archive status directory. Access is granted to members of the
+ pg_monitor role and may be granted to other
+ non-superuser roles.
+
+
|
pg_ls_tmpdir(tablespace oid)
GRANT.
+
+
pg_ls_archive_statusdir
+
+ pg_ls_archive_statusdir returns the name, size, and
+ last modified time (mtime) of each file in the WAL archive status
+ directory pg_wal/archive_status. By default only
+ superusers and members of the pg_monitor role can
+ use this function. Access may be granted to others using
+ GRANT.
+
+
REVOKE EXECUTE ON FUNCTION pg_ls_logdir() FROM public;
REVOKE EXECUTE ON FUNCTION pg_ls_waldir() FROM public;
+REVOKE EXECUTE ON FUNCTION pg_ls_archive_statusdir() FROM public;
REVOKE EXECUTE ON FUNCTION pg_ls_tmpdir() FROM public;
REVOKE EXECUTE ON FUNCTION pg_ls_tmpdir(oid) FROM public;
--
GRANT EXECUTE ON FUNCTION pg_ls_logdir() TO pg_monitor;
GRANT EXECUTE ON FUNCTION pg_ls_waldir() TO pg_monitor;
+GRANT EXECUTE ON FUNCTION pg_ls_archive_statusdir() TO pg_monitor;
GRANT EXECUTE ON FUNCTION pg_ls_tmpdir() TO pg_monitor;
GRANT EXECUTE ON FUNCTION pg_ls_tmpdir(oid) TO pg_monitor;
{
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);
+}
provolatile => 'v', prorettype => 'record', proargtypes => '',
proallargtypes => '{text,int8,timestamptz}', proargmodes => '{o,o,o}',
proargnames => '{name,size,modification}', prosrc => 'pg_ls_waldir' },
+{ oid => '5031', descr => 'list of files in the archive_status directory',
+ proname => 'pg_ls_archive_statusdir', procost => '10', prorows => '20', proretset => 't',
+ provolatile => 'v', prorettype => 'record', proargtypes => '',
+ proallargtypes => '{text,int8,timestamptz}', proargmodes => '{o,o,o}',
+ proargnames => '{name,size,modification}', prosrc => 'pg_ls_archive_statusdir' },
{ oid => '5029', descr => 'list files in the pgsql_tmp directory',
proname => 'pg_ls_tmpdir', procost => '10', prorows => '20', proretset => 't',
provolatile => 'v', prorettype => 'record', proargtypes => '',