Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Kapila2020-10-20 04:54:36 +0000
committerAmit Kapila2020-10-20 04:54:36 +0000
commit03d51b776d88badbeb4452c1ab452feb78dce36a (patch)
treeb5003547bd841ccb99cf39536c95ac241224a6a3 /contrib/test_decoding/sql
parent8e5793ab60bba65ffaa0f2237b39c9580d8972c7 (diff)
Change the attribute name in pg_stat_replication_slots view.
Change the attribute 'name' to 'slot_name' in pg_stat_replication_slots view to make it clear and that way we will be consistent with the other places like pg_stat_wal_receiver view where we display the same attribute. In the passing, fix the typo in one of the macros in the related code. Bump the catversion as we have modified the name in the catalog as well. Reported-by: Noriyoshi Shinoda Author: Noriyoshi Shinoda Reviewed-by: Sawada Masahiko and Amit Kapila Discussion: https://postgr.es/m/CA+fd4k5_pPAYRTDrO2PbtTOe0eHQpBvuqmCr8ic39uTNmR49Eg@mail.gmail.com
Diffstat (limited to 'contrib/test_decoding/sql')
-rw-r--r--contrib/test_decoding/sql/stats.sql8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/test_decoding/sql/stats.sql b/contrib/test_decoding/sql/stats.sql
index b95adb16fa7..182df84030d 100644
--- a/contrib/test_decoding/sql/stats.sql
+++ b/contrib/test_decoding/sql/stats.sql
@@ -19,7 +19,7 @@ BEGIN
ELSE (spill_txns > 0)
END
INTO updated
- FROM pg_stat_replication_slots WHERE name='regression_slot';
+ FROM pg_stat_replication_slots WHERE slot_name='regression_slot';
exit WHEN updated;
@@ -47,17 +47,17 @@ SELECT count(*) FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL,
-- exact stats count as that can vary if any background transaction (say by
-- autovacuum) happens in parallel to the main transaction.
SELECT wait_for_decode_stats(false);
-SELECT name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
+SELECT slot_name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
-- reset the slot stats, and wait for stats collector to reset
SELECT pg_stat_reset_replication_slot('regression_slot');
SELECT wait_for_decode_stats(true);
-SELECT name, spill_txns, spill_count FROM pg_stat_replication_slots;
+SELECT slot_name, spill_txns, spill_count FROM pg_stat_replication_slots;
-- decode and check stats again.
SELECT count(*) FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'skip-empty-xacts', '1');
SELECT wait_for_decode_stats(false);
-SELECT name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
+SELECT slot_name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
DROP FUNCTION wait_for_decode_stats(bool);
DROP TABLE stats_test;