summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Paquier2021-11-23 10:29:42 +0000
committerMichael Paquier2021-11-23 10:29:42 +0000
commit1922d7c6e1a74178bd2f1d5aa5a6ab921b3fcd34 (patch)
treef50330db40f2049bf53b7f7f3801d46b20058d05 /src/include
parentb55f2b6926556115155930c4b2d006c173f45e65 (diff)
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
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_proc.dat22
2 files changed, 23 insertions, 1 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index cb7117df3ea..920390b8b2a 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202111171
+#define CATALOG_VERSION_NO 202111231
#endif
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 6412f369f18..e934361dc32 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -11623,6 +11623,28 @@
proallargtypes => '{oid,text,int8,timestamptz}', proargmodes => '{i,o,o,o}',
proargnames => '{tablespace,name,size,modification}',
prosrc => 'pg_ls_tmpdir_1arg' },
+{ oid => '9858',
+ descr => 'list of files in the pg_logical/snapshots directory',
+ proname => 'pg_ls_logicalsnapdir', 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_logicalsnapdir' },
+{ oid => '9859',
+ descr => 'list of files in the pg_logical/mappings directory',
+ proname => 'pg_ls_logicalmapdir', 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_logicalmapdir' },
+{ oid => '9860',
+ descr => 'list of files in the pg_replslot/slot_name directory',
+ proname => 'pg_ls_replslotdir', procost => '10', prorows => '20',
+ proretset => 't', provolatile => 'v', prorettype => 'record',
+ proargtypes => 'text', proallargtypes => '{text,text,int8,timestamptz}',
+ proargmodes => '{i,o,o,o}',
+ proargnames => '{slot_name,name,size,modification}',
+ prosrc => 'pg_ls_replslotdir' },
# hash partitioning constraint function
{ oid => '5028', descr => 'hash partition CHECK constraint',