Add SQL functions to monitor the directory contents of replication slots
authorMichael Paquier <michael@paquier.xyz>
Tue, 23 Nov 2021 10:29:42 +0000 (19:29 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 23 Nov 2021 10:29:42 +0000 (19:29 +0900)
commit1922d7c6e1a74178bd2f1d5aa5a6ab921b3fcd34
treef50330db40f2049bf53b7f7f3801d46b20058d05
parentb55f2b6926556115155930c4b2d006c173f45e65
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
contrib/test_decoding/expected/slot.out
contrib/test_decoding/sql/slot.sql
doc/src/sgml/func.sgml
src/backend/catalog/system_functions.sql
src/backend/utils/adt/genfile.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/test/regress/expected/misc_functions.out
src/test/regress/sql/misc_functions.sql