Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5961722

Browse files
committed
pgstat: drop subscription stats regardless of slot, fix comment
There's no reason anymore to only drop subscription stats if associated with a slot, now that stats drops are transactional. Additionally, the comment referring to autovacuum cleaning up stats was clearly outdated. Author: Masahiko Sawada <sawada.mshk@gmail.com> Discussion: https://postgr.es/m/CAD21AoAwiby3HeJE7vJe16Gr75RFfJ640dyHqvsiUhyKJTXPtw@mail.gmail.com Backpatch: 15-
1 parent 30efc3b commit 5961722

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/backend/commands/subscriptioncmds.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,15 +1579,9 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
15791579

15801580
/*
15811581
* Tell the cumulative stats system that the subscription is getting
1582-
* dropped. We can safely report dropping the subscription statistics here
1583-
* if the subscription is associated with a replication slot since we
1584-
* cannot run DROP SUBSCRIPTION inside a transaction block. Subscription
1585-
* statistics will be removed later by (auto)vacuum either if it's not
1586-
* associated with a replication slot or if the message for dropping the
1587-
* subscription gets lost.
1582+
* dropped.
15881583
*/
1589-
if (slotname)
1590-
pgstat_drop_subscription(subid);
1584+
pgstat_drop_subscription(subid);
15911585

15921586
table_close(rel, NoLock);
15931587
}

0 commit comments

Comments
 (0)