@@ -334,11 +334,9 @@ pgws_general_dimensions_check_hook (char **newvalue, void **extra, GucSource sou
334334 int extrachecks = 0 ;
335335 int * myextra ;
336336
337- /* Check special cases when we turn all or none dimensions */
337+ /* Check special case when we turn all dimensions */
338338 if (pg_strcasecmp (* newvalue , "all" ) == 0 )
339339 extrachecks = PGWS_DIMENSIONS_ALL ;
340- else if (pg_strcasecmp (* newvalue , "none" ) == 0 )
341- extrachecks = PGWS_DIMENSIONS_NONE ;
342340 else
343341 {
344342 /* Need a modifiable copy of string */
@@ -388,7 +386,7 @@ pgws_general_dimensions_check_hook (char **newvalue, void **extra, GucSource sou
388386 extrachecks |= PGWS_DIMENSIONS_CLIENT_HOSTNAME ;
389387 else if (pg_strcasecmp (tok , "appname" ) == 0 )
390388 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 )
392390 {
393391 GUC_check_errdetail ("Key word \"%s\" cannot be combined with other key words." , tok );
394392 pfree (rawstring );
@@ -747,8 +745,17 @@ get_beentry_by_procpid(int pid)
747745 /* Here beid is just index in localBackendStatusTable */
748746 local_beentry = pgstat_fetch_stat_local_beentry (cur_be_idx );
749747#endif
748+ #if defined(PGPRO_EE ) || defined(PGPRO_STD ) && PG_VERSION_NUM >= 160000
750749 if (local_beentry -> backendStatus -> st_procpid == pid )
751750 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
752759 }
753760 return NULL ;
754761}
@@ -831,12 +838,12 @@ fill_values_and_nulls(Datum *values, bool *nulls, SamplingDimensions dimensions,
831838 values [3 ] = UInt64GetDatum (dimensions .queryId );
832839 else
833840 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;
838841 if (api_version >= PGWS_V1_2 )
839842 {
843+ if (dimensions_mask & PGWS_DIMENSIONS_ROLE_ID )
844+ values [4 ] = ObjectIdGetDatum (dimensions .role_id );
845+ else
846+ nulls [4 ] = true;
840847 if (dimensions_mask & PGWS_DIMENSIONS_DB_ID )
841848 values [5 ] = ObjectIdGetDatum (dimensions .database_id );
842849 else
@@ -887,7 +894,7 @@ PG_FUNCTION_INFO_V1(pg_wait_sampling_get_current_1_2);
887894Datum
888895pg_wait_sampling_get_current_1_2 (PG_FUNCTION_ARGS )
889896{
890- return pg_wait_sampling_get_current_internal (fcinfo , PGWS_V1_2 );
897+ return pg_wait_sampling_get_current_internal (fcinfo , PGWS_V1_2 );
891898}
892899
893900Datum
@@ -1187,7 +1194,7 @@ PG_FUNCTION_INFO_V1(pg_wait_sampling_get_profile_1_2);
11871194Datum
11881195pg_wait_sampling_get_profile_1_2 (PG_FUNCTION_ARGS )
11891196{
1190- return pg_wait_sampling_get_profile_internal (fcinfo , PGWS_V1_2 );
1197+ return pg_wait_sampling_get_profile_internal (fcinfo , PGWS_V1_2 );
11911198}
11921199
11931200Datum
@@ -1328,7 +1335,7 @@ pg_wait_sampling_reset_history(PG_FUNCTION_ARGS)
13281335 LockAcquire (& collectorTag , ExclusiveLock , false, false);
13291336 pgws_collector_hdr -> request = HISTORY_RESET ;
13301337 LockRelease (& collectorTag , ExclusiveLock , false);
1331-
1338+
13321339 if (!pgws_collector_hdr -> latch )
13331340 ereport (ERROR , (errcode (ERRCODE_INTERNAL_ERROR ),
13341341 errmsg ("pg_wait_sampling collector wasn't started" )));
@@ -1351,7 +1358,7 @@ PG_FUNCTION_INFO_V1(pg_wait_sampling_get_history_1_2);
13511358Datum
13521359pg_wait_sampling_get_history_1_2 (PG_FUNCTION_ARGS )
13531360{
1354- return pg_wait_sampling_get_history_internal (fcinfo , PGWS_V1_2 );
1361+ return pg_wait_sampling_get_history_internal (fcinfo , PGWS_V1_2 );
13551362}
13561363
13571364Datum
0 commit comments