Skip to content

Commit

Permalink
Fix PgBackendStatus retrieval for PG16 (#62)
Browse files Browse the repository at this point in the history
It was working only because backendStatus is a first field in the returned structure.
  • Loading branch information
hughcapet authored Dec 13, 2023
1 parent 8f57d08 commit f023c55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgres_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ static void get_pg_stat_activity(pg_stat_activity_list *pg_stats)
for (i = 1; i <= num_backends; ++i)
{
#if PG_VERSION_NUM >= 160000
PgBackendStatus *beentry = pgstat_get_local_beentry_by_index(i);
PgBackendStatus *beentry = &pgstat_get_local_beentry_by_index(i)->backendStatus;
#else
PgBackendStatus *beentry = pgstat_fetch_stat_beentry(i);
#endif
Expand Down

0 comments on commit f023c55

Please sign in to comment.