@@ -303,7 +303,7 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS)
303
303
Datum
304
304
pg_stat_get_activity (PG_FUNCTION_ARGS )
305
305
{
306
- #define PG_STAT_GET_ACTIVITY_COLS 31
306
+ #define PG_STAT_GET_ACTIVITY_COLS 33
307
307
int num_backends = pgstat_fetch_stat_numbackends ();
308
308
int curr_backend ;
309
309
int pid = PG_ARGISNULL (0 ) ? -1 : PG_GETARG_INT32 (0 );
@@ -395,7 +395,7 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
395
395
pfree (clipped_activity );
396
396
397
397
/* leader_pid */
398
- nulls [29 ] = true;
398
+ nulls [31 ] = true;
399
399
400
400
proc = BackendPidGetProc (beentry -> st_procpid );
401
401
@@ -432,17 +432,17 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
432
432
*/
433
433
if (leader && leader -> pid != beentry -> st_procpid )
434
434
{
435
- values [29 ] = Int32GetDatum (leader -> pid );
436
- nulls [29 ] = false;
435
+ values [31 ] = Int32GetDatum (leader -> pid );
436
+ nulls [31 ] = false;
437
437
}
438
438
else if (beentry -> st_backendType == B_BG_WORKER )
439
439
{
440
440
int leader_pid = GetLeaderApplyWorkerPid (beentry -> st_procpid );
441
441
442
442
if (leader_pid != InvalidPid )
443
443
{
444
- values [29 ] = Int32GetDatum (leader_pid );
445
- nulls [29 ] = false;
444
+ values [31 ] = Int32GetDatum (leader_pid );
445
+ nulls [31 ] = false;
446
446
}
447
447
}
448
448
}
@@ -587,35 +587,45 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
587
587
values [24 ] = CStringGetTextDatum (beentry -> st_sslstatus -> ssl_issuer_dn );
588
588
else
589
589
nulls [24 ] = true;
590
+
591
+ if (beentry -> st_sslstatus -> ssl_not_before != 0 )
592
+ values [25 ] = TimestampGetDatum (beentry -> st_sslstatus -> ssl_not_before );
593
+ else
594
+ nulls [25 ] = true;
595
+
596
+ if (beentry -> st_sslstatus -> ssl_not_after != 0 )
597
+ values [26 ] = TimestampGetDatum (beentry -> st_sslstatus -> ssl_not_after );
598
+ else
599
+ nulls [26 ] = true;
590
600
}
591
601
else
592
602
{
593
603
values [18 ] = BoolGetDatum (false); /* ssl */
594
- nulls [19 ] = nulls [20 ] = nulls [21 ] = nulls [22 ] = nulls [23 ] = nulls [24 ] = true;
604
+ nulls [19 ] = nulls [20 ] = nulls [21 ] = nulls [22 ] = nulls [23 ] = nulls [24 ] = nulls [ 25 ] = nulls [ 26 ] = true;
595
605
}
596
606
597
607
/* GSSAPI information */
598
608
if (beentry -> st_gss )
599
609
{
600
- values [25 ] = BoolGetDatum (beentry -> st_gssstatus -> gss_auth ); /* gss_auth */
601
- values [26 ] = CStringGetTextDatum (beentry -> st_gssstatus -> gss_princ );
602
- values [27 ] = BoolGetDatum (beentry -> st_gssstatus -> gss_enc ); /* GSS Encryption in use */
603
- values [28 ] = BoolGetDatum (beentry -> st_gssstatus -> gss_delegation ); /* GSS credentials
610
+ values [27 ] = BoolGetDatum (beentry -> st_gssstatus -> gss_auth ); /* gss_auth */
611
+ values [28 ] = CStringGetTextDatum (beentry -> st_gssstatus -> gss_princ );
612
+ values [29 ] = BoolGetDatum (beentry -> st_gssstatus -> gss_enc ); /* GSS Encryption in use */
613
+ values [30 ] = BoolGetDatum (beentry -> st_gssstatus -> gss_delegation ); /* GSS credentials
604
614
* delegated */
605
615
}
606
616
else
607
617
{
608
- values [25 ] = BoolGetDatum (false); /* gss_auth */
609
- nulls [26 ] = true; /* No GSS principal */
610
- values [27 ] = BoolGetDatum (false); /* GSS Encryption not in
618
+ values [27 ] = BoolGetDatum (false); /* gss_auth */
619
+ nulls [28 ] = true; /* No GSS principal */
620
+ values [29 ] = BoolGetDatum (false); /* GSS Encryption not in
611
621
* use */
612
- values [28 ] = BoolGetDatum (false); /* GSS credentials not
622
+ values [30 ] = BoolGetDatum (false); /* GSS credentials not
613
623
* delegated */
614
624
}
615
625
if (beentry -> st_query_id == 0 )
616
- nulls [30 ] = true;
626
+ nulls [32 ] = true;
617
627
else
618
- values [30 ] = UInt64GetDatum (beentry -> st_query_id );
628
+ values [32 ] = UInt64GetDatum (beentry -> st_query_id );
619
629
}
620
630
else
621
631
{
@@ -645,6 +655,8 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
645
655
nulls [28 ] = true;
646
656
nulls [29 ] = true;
647
657
nulls [30 ] = true;
658
+ nulls [31 ] = true;
659
+ nulls [32 ] = true;
648
660
}
649
661
650
662
tuplestore_putvalues (rsinfo -> setResult , rsinfo -> setDesc , values , nulls );
0 commit comments