@@ -334,11 +334,9 @@ pgws_general_dimensions_check_hook (char **newvalue, void **extra, GucSource sou
334
334
int extrachecks = 0 ;
335
335
int * myextra ;
336
336
337
- /* Check special cases when we turn all or none dimensions */
337
+ /* Check special case when we turn all dimensions */
338
338
if (pg_strcasecmp (* newvalue , "all" ) == 0 )
339
339
extrachecks = PGWS_DIMENSIONS_ALL ;
340
- else if (pg_strcasecmp (* newvalue , "none" ) == 0 )
341
- extrachecks = PGWS_DIMENSIONS_NONE ;
342
340
else
343
341
{
344
342
/* Need a modifiable copy of string */
@@ -388,7 +386,7 @@ pgws_general_dimensions_check_hook (char **newvalue, void **extra, GucSource sou
388
386
extrachecks |= PGWS_DIMENSIONS_CLIENT_HOSTNAME ;
389
387
else if (pg_strcasecmp (tok , "appname" ) == 0 )
390
388
extrachecks |= PGWS_DIMENSIONS_APPNAME ;
391
- else if (pg_strcasecmp (tok , "all" ) == 0 || pg_strcasecmp ( tok , "none" ) == 0 )
389
+ else if (pg_strcasecmp (tok , "all" ) == 0 )
392
390
{
393
391
GUC_check_errdetail ("Key word \"%s\" cannot be combined with other key words." , tok );
394
392
pfree (rawstring );
@@ -747,8 +745,17 @@ get_beentry_by_procpid(int pid)
747
745
/* Here beid is just index in localBackendStatusTable */
748
746
local_beentry = pgstat_fetch_stat_local_beentry (cur_be_idx );
749
747
#endif
748
+ #if defined(PGPRO_EE ) || defined(PGPRO_STD ) && PG_VERSION_NUM >= 160000
750
749
if (local_beentry -> backendStatus -> st_procpid == pid )
751
750
return local_beentry -> backendStatus ;
751
+ #else
752
+ if (local_beentry -> backendStatus .st_procpid == pid )
753
+ {
754
+ PgBackendStatus * result = palloc0 (sizeof (PgBackendStatus ));
755
+ * result = local_beentry -> backendStatus ;
756
+ return result ;
757
+ }
758
+ #endif
752
759
}
753
760
return NULL ;
754
761
}
@@ -831,12 +838,12 @@ fill_values_and_nulls(Datum *values, bool *nulls, SamplingDimensions dimensions,
831
838
values [3 ] = UInt64GetDatum (dimensions .queryId );
832
839
else
833
840
values [3 ] = (Datum ) 0 ;
834
- if (dimensions_mask & PGWS_DIMENSIONS_ROLE_ID )
835
- values [4 ] = ObjectIdGetDatum (dimensions .role_id );
836
- else
837
- nulls [4 ] = true;
838
841
if (api_version >= PGWS_V1_2 )
839
842
{
843
+ if (dimensions_mask & PGWS_DIMENSIONS_ROLE_ID )
844
+ values [4 ] = ObjectIdGetDatum (dimensions .role_id );
845
+ else
846
+ nulls [4 ] = true;
840
847
if (dimensions_mask & PGWS_DIMENSIONS_DB_ID )
841
848
values [5 ] = ObjectIdGetDatum (dimensions .database_id );
842
849
else
@@ -887,7 +894,7 @@ PG_FUNCTION_INFO_V1(pg_wait_sampling_get_current_1_2);
887
894
Datum
888
895
pg_wait_sampling_get_current_1_2 (PG_FUNCTION_ARGS )
889
896
{
890
- return pg_wait_sampling_get_current_internal (fcinfo , PGWS_V1_2 );
897
+ return pg_wait_sampling_get_current_internal (fcinfo , PGWS_V1_2 );
891
898
}
892
899
893
900
Datum
@@ -1187,7 +1194,7 @@ PG_FUNCTION_INFO_V1(pg_wait_sampling_get_profile_1_2);
1187
1194
Datum
1188
1195
pg_wait_sampling_get_profile_1_2 (PG_FUNCTION_ARGS )
1189
1196
{
1190
- return pg_wait_sampling_get_profile_internal (fcinfo , PGWS_V1_2 );
1197
+ return pg_wait_sampling_get_profile_internal (fcinfo , PGWS_V1_2 );
1191
1198
}
1192
1199
1193
1200
Datum
@@ -1328,7 +1335,7 @@ pg_wait_sampling_reset_history(PG_FUNCTION_ARGS)
1328
1335
LockAcquire (& collectorTag , ExclusiveLock , false, false);
1329
1336
pgws_collector_hdr -> request = HISTORY_RESET ;
1330
1337
LockRelease (& collectorTag , ExclusiveLock , false);
1331
-
1338
+
1332
1339
if (!pgws_collector_hdr -> latch )
1333
1340
ereport (ERROR , (errcode (ERRCODE_INTERNAL_ERROR ),
1334
1341
errmsg ("pg_wait_sampling collector wasn't started" )));
@@ -1351,7 +1358,7 @@ PG_FUNCTION_INFO_V1(pg_wait_sampling_get_history_1_2);
1351
1358
Datum
1352
1359
pg_wait_sampling_get_history_1_2 (PG_FUNCTION_ARGS )
1353
1360
{
1354
- return pg_wait_sampling_get_history_internal (fcinfo , PGWS_V1_2 );
1361
+ return pg_wait_sampling_get_history_internal (fcinfo , PGWS_V1_2 );
1355
1362
}
1356
1363
1357
1364
Datum
0 commit comments