diff options
author | Andres Freund <andres@anarazel.de> | 2022-07-06 08:46:04 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2022-07-06 08:49:33 -0700 |
commit | 596172260a6ddc78be85d929c309da3c941fe683 (patch) | |
tree | e37320add4a050a7b87222cbbe5c007cf72b86cf /src | |
parent | 30efc3b5a3648bc64c7a8b058030756bb81292e1 (diff) | |
download | postgresql-596172260a6ddc78be85d929c309da3c941fe683.tar.gz postgresql-596172260a6ddc78be85d929c309da3c941fe683.zip |
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-
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/subscriptioncmds.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 83e6eae855f..3842a4fd445 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -1579,15 +1579,9 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) /* * Tell the cumulative stats system that the subscription is getting - * dropped. We can safely report dropping the subscription statistics here - * if the subscription is associated with a replication slot since we - * cannot run DROP SUBSCRIPTION inside a transaction block. Subscription - * statistics will be removed later by (auto)vacuum either if it's not - * associated with a replication slot or if the message for dropping the - * subscription gets lost. + * dropped. */ - if (slotname) - pgstat_drop_subscription(subid); + pgstat_drop_subscription(subid); table_close(rel, NoLock); } |