mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Add SQL functions to monitor the directory contents of replication slots
This commit adds a set of functions able to look at the contents of various paths related to replication slots: - pg_ls_logicalsnapdir, for pg_logical/snapshots/ - pg_ls_logicalmapdir, for pg_logical/mappings/ - pg_ls_replslotdir, for pg_replslot/<slot_name>/ These are intended to be used by monitoring tools. Unlike pg_ls_dir(), execution permission can be granted to non-superusers. Roles members of pg_monitor gain have access to those functions. Bump catalog version. Author: Bharath Rupireddy Reviewed-by: Nathan Bossart, Justin Pryzby Discussion: https://postgr.es/m/CALj2ACWsfizZjMN6bzzdxOk1ADQQeSw8HhEjhmVXn_Pu+7VzLw@mail.gmail.com
This commit is contained in:
@@ -27417,6 +27417,79 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
|
||||
can be granted EXECUTE to run the function.
|
||||
</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry role="func_table_entry"><para role="func_signature">
|
||||
<indexterm>
|
||||
<primary>pg_ls_logicalsnapdir</primary>
|
||||
</indexterm>
|
||||
<function>pg_ls_logicalsnapdir</function> ()
|
||||
<returnvalue>setof record</returnvalue>
|
||||
( <parameter>name</parameter> <type>text</type>,
|
||||
<parameter>size</parameter> <type>bigint</type>,
|
||||
<parameter>modification</parameter> <type>timestamp with time zone</type> )
|
||||
</para>
|
||||
<para>
|
||||
Returns the name, size, and last modification time (mtime) of each
|
||||
ordinary file in the server's <filename>pg_logical/snapshots</filename>
|
||||
directory. Filenames beginning with a dot, directories, and other
|
||||
special files are excluded.
|
||||
</para>
|
||||
<para>
|
||||
This function is restricted to superusers and members of
|
||||
the <literal>pg_monitor</literal> role by default, but other users can
|
||||
be granted EXECUTE to run the function.
|
||||
</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry role="func_table_entry"><para role="func_signature">
|
||||
<indexterm>
|
||||
<primary>pg_ls_logicalmapdir</primary>
|
||||
</indexterm>
|
||||
<function>pg_ls_logicalmapdir</function> ()
|
||||
<returnvalue>setof record</returnvalue>
|
||||
( <parameter>name</parameter> <type>text</type>,
|
||||
<parameter>size</parameter> <type>bigint</type>,
|
||||
<parameter>modification</parameter> <type>timestamp with time zone</type> )
|
||||
</para>
|
||||
<para>
|
||||
Returns the name, size, and last modification time (mtime) of each
|
||||
ordinary file in the server's <filename>pg_logical/mappings</filename>
|
||||
directory. Filenames beginning with a dot, directories, and other
|
||||
special files are excluded.
|
||||
</para>
|
||||
<para>
|
||||
This function is restricted to superusers and members of
|
||||
the <literal>pg_monitor</literal> role by default, but other users can
|
||||
be granted EXECUTE to run the function.
|
||||
</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry role="func_table_entry"><para role="func_signature">
|
||||
<indexterm>
|
||||
<primary>pg_ls_replslotdir</primary>
|
||||
</indexterm>
|
||||
<function>pg_ls_replslotdir</function> ( <parameter>slot_name</parameter> <type>text</type> )
|
||||
<returnvalue>setof record</returnvalue>
|
||||
( <parameter>name</parameter> <type>text</type>,
|
||||
<parameter>size</parameter> <type>bigint</type>,
|
||||
<parameter>modification</parameter> <type>timestamp with time zone</type> )
|
||||
</para>
|
||||
<para>
|
||||
Returns the name, size, and last modification time (mtime) of each
|
||||
ordinary file in the server's <filename>pg_replslot/slot_name</filename>
|
||||
directory, where <parameter>slot_name</parameter> is the name of the
|
||||
replication slot provided as input of the function. Filenames beginning
|
||||
with a dot, directories, and other special files are excluded.
|
||||
</para>
|
||||
<para>
|
||||
This function is restricted to superusers and members of
|
||||
the <literal>pg_monitor</literal> role by default, but other users can
|
||||
be granted EXECUTE to run the function.
|
||||
</para></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user