We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25bd499 commit aeabc16Copy full SHA for aeabc16
pg_query_state.c
@@ -365,10 +365,16 @@ search_be_status(int pid)
365
366
for (beid = 1; beid <= pgstat_fetch_stat_numbackends(); beid++)
367
{
368
-#if PG_VERSION_NUM >= 170000
369
- PgBackendStatus *be_status = pgstat_get_beentry_by_proc_number(beid);
370
-#elif PG_VERSION_NUM >= 160000
371
- PgBackendStatus *be_status = pgstat_get_beentry_by_backend_id(beid);
+#if PG_VERSION_NUM >= 160000
+ LocalPgBackendStatus *lbe_status = pgstat_get_local_beentry_by_index(beid);
+ PgBackendStatus *be_status;
+
372
+ Assert(lbe_status);
373
+ #ifndef PGPRO_STD
374
+ be_status = &lbe_status->backendStatus;
375
+ #else
376
+ be_status = lbe_status->backendStatus;
377
+ #endif
378
#else
379
PgBackendStatus *be_status = pgstat_fetch_stat_beentry(beid);
380
#endif
0 commit comments