From 578f8f51e7213b22152db7447d94f7fd48bf3893 Mon Sep 17 00:00:00 2001
From: Vigneshwaran C <vignesh21@gmail.com>
Date: Sun, 27 Mar 2022 11:30:09 +0530
Subject: [PATCH] pg_stat_get_replication_slot NULL handling.

Set isstrict to true for pg_stat_get_replication_slot function.
---
 src/include/catalog/pg_proc.dat              | 2 +-
 src/test/regress/expected/misc_functions.out | 9 +++++++++
 src/test/regress/sql/misc_functions.sql      | 5 +++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 699bd0aa3e..c14ccccdf5 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -5370,7 +5370,7 @@
   proargnames => '{pid,status,receive_start_lsn,receive_start_tli,written_lsn,flushed_lsn,received_tli,last_msg_send_time,last_msg_receipt_time,latest_end_lsn,latest_end_time,slot_name,sender_host,sender_port,conninfo}',
   prosrc => 'pg_stat_get_wal_receiver' },
 { oid => '6169', descr => 'statistics: information about replication slot',
-  proname => 'pg_stat_get_replication_slot', proisstrict => 'f', provolatile => 's',
+  proname => 'pg_stat_get_replication_slot', proisstrict => 't', provolatile => 's',
   proparallel => 'r', prorettype => 'record', proargtypes => 'text',
   proallargtypes => '{text,text,int8,int8,int8,int8,int8,int8,int8,int8,timestamptz}',
   proargmodes => '{i,o,o,o,o,o,o,o,o,o,o}',
diff --git a/src/test/regress/expected/misc_functions.out b/src/test/regress/expected/misc_functions.out
index 01d1ad0b9a..900e89342c 100644
--- a/src/test/regress/expected/misc_functions.out
+++ b/src/test/regress/expected/misc_functions.out
@@ -466,6 +466,15 @@ SELECT has_function_privilege('regress_slot_dir_funcs',
 (1 row)
 
 DROP ROLE regress_slot_dir_funcs;
+--
+-- Test NULL handling of pg_stat_get_replication_slot
+--
+SELECT pg_stat_get_replication_slot(NULL);
+ pg_stat_get_replication_slot 
+------------------------------
+ 
+(1 row)
+
 --
 -- Test adding a support function to a subject function
 --
diff --git a/src/test/regress/sql/misc_functions.sql b/src/test/regress/sql/misc_functions.sql
index 072fc36a1f..34895a58c1 100644
--- a/src/test/regress/sql/misc_functions.sql
+++ b/src/test/regress/sql/misc_functions.sql
@@ -161,6 +161,11 @@ SELECT has_function_privilege('regress_slot_dir_funcs',
   'pg_ls_replslotdir(text)', 'EXECUTE');
 DROP ROLE regress_slot_dir_funcs;
 
+--
+-- Test NULL handling of pg_stat_get_replication_slot
+--
+SELECT pg_stat_get_replication_slot(NULL);
+
 --
 -- Test adding a support function to a subject function
 --
-- 
2.32.0

