Change pgstat_report_vacuum() to use Relation master github/master
authorMichael Paquier <[email protected]>
Wed, 17 Dec 2025 02:26:17 +0000 (11:26 +0900)
committerMichael Paquier <[email protected]>
Wed, 17 Dec 2025 02:26:17 +0000 (11:26 +0900)
commitf4e797171eac645eeae2a5e95bf3361bb7f7f0cc
tree99ae443818303a6db1af1d4a35fe988d6e693268
parent1d325ad99cb2dec0e8b45ba36909ee0a497d2a57
Change pgstat_report_vacuum() to use Relation

This change makes pgstat_report_vacuum() more consistent with
pgstat_report_analyze(), that also uses a Relation.  This enforces a
policy that callers of this routine should open and lock the relation
whose statistics are updated before calling this routine.  We will
unlikely have a lot of callers of this routine in the tree, but it seems
like a good idea to imply this requirement in the long run.

Author: Bertrand Drouvot <[email protected]>
Suggested-by: Andres Freund <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Discussion: https://postgr.es/m/[email protected]
src/backend/access/heap/vacuumlazy.c
src/backend/utils/activity/pgstat_relation.c
src/include/pgstat.h