aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/activity/pgstat_shmem.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-08-02 04:49:34 +0900
committerMichael Paquier <michael@paquier.xyz>2024-08-02 04:49:34 +0900
commit3188a4582a8ce8223fba6e08636d8aaa4cbfd29f (patch)
tree9cf1f5d4bbafc429a540203cc586d546a0d25f6c /src/backend/utils/activity/pgstat_shmem.c
parentb860848232aab440c9ac4c5de3563565e3d2934b (diff)
downloadpostgresql-3188a4582a8ce8223fba6e08636d8aaa4cbfd29f.tar.gz
postgresql-3188a4582a8ce8223fba6e08636d8aaa4cbfd29f.zip
Switch PgStat_Kind from an enum to a uint32 type
A follow-up patch is planned to make cumulative statistics pluggable, and using a type is useful in the internal routines used by pgstats as PgStat_Kind may have a value that was not originally in the enum removed here, once made pluggable. While on it, this commit switches pgstat_is_kind_valid() to use PgStat_Kind rather than an int, to be more consistent with its existing callers. Some loops based on the stats kind IDs are switched to use PgStat_Kind rather than int, for consistency with the new time. Author: Michael Paquier Reviewed-by: Dmitry Dolgov, Bertrand Drouvot Discussion: https://postgr.es/m/Zmqm9j5EO0I4W8dx@paquier.xyz
Diffstat (limited to 'src/backend/utils/activity/pgstat_shmem.c')
-rw-r--r--src/backend/utils/activity/pgstat_shmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/activity/pgstat_shmem.c b/src/backend/utils/activity/pgstat_shmem.c
index 1c2b69d5634..2d5f7d46de7 100644
--- a/src/backend/utils/activity/pgstat_shmem.c
+++ b/src/backend/utils/activity/pgstat_shmem.c
@@ -197,7 +197,7 @@ StatsShmemInit(void)
pg_atomic_init_u64(&ctl->gc_request_count, 1);
/* initialize fixed-numbered stats */
- for (int kind = PGSTAT_KIND_FIRST_VALID; kind <= PGSTAT_KIND_LAST; kind++)
+ for (PgStat_Kind kind = PGSTAT_KIND_FIRST_VALID; kind <= PGSTAT_KIND_LAST; kind++)
{
const PgStat_KindInfo *kind_info = pgstat_get_kind_info(kind);
char *ptr;