Skip to content

Commit afd0fcb

Browse files
committed
Fix test_decoding test case's check that slot has been dropped.
pg_stat_replication shows connected replication clients. The ddl test case never has any replication clients connected, so querying pg_stat_replication is pointless. To check that a slot has been dropped correctly, query pg_replication_slots instead. Andres Freund
1 parent 03e2b10 commit afd0fcb

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

contrib/test_decoding/expected/ddl.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,9 @@ SELECT pg_drop_replication_slot('regression_slot');
639639

640640
(1 row)
641641

642-
/* check that we aren't visible anymore now */
643-
SELECT * FROM pg_stat_replication;
644-
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_location | write_location | flush_location | replay_location | sync_priority | sync_state
645-
-----+----------+---------+------------------+-------------+-----------------+-------------+---------------+--------------+-------+---------------+----------------+----------------+-----------------+---------------+------------
642+
/* check that the slot is gone */
643+
SELECT * FROM pg_replication_slots;
644+
slot_name | plugin | slot_type | datoid | database | active | xmin | catalog_xmin | restart_lsn
645+
-----------+--------+-----------+--------+----------+--------+------+--------------+-------------
646646
(0 rows)
647647

contrib/test_decoding/sql/ddl.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
331331

332332
-- done, free logical replication slot
333333
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0');
334+
334335
SELECT pg_drop_replication_slot('regression_slot');
335336

336-
/* check that we aren't visible anymore now */
337-
SELECT * FROM pg_stat_replication;
337+
/* check that the slot is gone */
338+
SELECT * FROM pg_replication_slots;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy