@ -19646,7 +19646,8 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
database cluster directory and the <varname>log_directory</> can be
database cluster directory and the <varname>log_directory</> can be
accessed. Use a relative path for files in the cluster directory,
accessed. Use a relative path for files in the cluster directory,
and a path matching the <varname>log_directory</> configuration setting
and a path matching the <varname>log_directory</> configuration setting
for log files. Use of these functions is restricted to superusers.
for log files. Use of these functions is restricted to superusers
except where stated otherwise.
</para>
</para>
<table id="functions-admin-genfile-table">
<table id="functions-admin-genfile-table">
@ -19667,6 +19668,26 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
List the contents of a directory.
List the contents of a directory.
</entry>
</entry>
</row>
</row>
<row>
<entry>
<literal><function>pg_ls_logdir()</function></literal>
</entry>
<entry><type>setof record</type></entry>
<entry>
List the name, size, and last modification time of files in the log
directory. Access may be granted to non-superuser roles.
</entry>
</row>
<row>
<entry>
<literal><function>pg_ls_waldir()</function></literal>
</entry>
<entry><type>setof record</type></entry>
<entry>
List the name, size, and last modification time of files in the WAL
directory. Access may be granted to non-superuser roles.
</entry>
</row>
<row>
<row>
<entry>
<entry>
<literal><function>pg_read_file(<parameter>filename</> <type>text</> [, <parameter>offset</> <type>bigint</>, <parameter>length</> <type>bigint</> [, <parameter>missing_ok</> <type>boolean</>] ])</function></literal>
<literal><function>pg_read_file(<parameter>filename</> <type>text</> [, <parameter>offset</> <type>bigint</>, <parameter>length</> <type>bigint</> [, <parameter>missing_ok</> <type>boolean</>] ])</function></literal>
@ -19699,7 +19720,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
</table>
</table>
<para>
<para>
All of these functions take an optional <parameter>missing_ok</> parameter,
Some of these functions take an optional <parameter>missing_ok</> parameter,
which specifies the behavior when the file or directory does not exist.
which specifies the behavior when the file or directory does not exist.
If <literal>true</literal>, the function returns NULL (except
If <literal>true</literal>, the function returns NULL (except
<function>pg_ls_dir</>, which returns an empty result set). If
<function>pg_ls_dir</>, which returns an empty result set). If
@ -19719,6 +19740,26 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
empty directory from an non-existent directory.
empty directory from an non-existent directory.
</para>
</para>
<indexterm>
<primary>pg_ls_logdir</primary>
</indexterm>
<para>
<function>pg_ls_logdir</> returns the name, size, and last modified time
(mtime) of each file in the log directory. By default, only superusers
can use this function, but access may be granted to others using
<command>GRANT</command>.
</para>
<indexterm>
<primary>pg_ls_waldir</primary>
</indexterm>
<para>
<function>pg_ls_waldir</> returns the name, size, and last modified time
(mtime) of each file in the write ahead log (WAL) directory. By
default only superusers can use this function, but access may be granted
to others using <command>GRANT</command>.
</para>
<indexterm>
<indexterm>
<primary>pg_read_file</primary>
<primary>pg_read_file</primary>
</indexterm>
</indexterm>