@@ -864,6 +864,7 @@ PHP_FUNCTION(pg_close)
864
864
#define PHP_PG_TTY 5
865
865
#define PHP_PG_HOST 6
866
866
#define PHP_PG_VERSION 7
867
+ #define PHP_PG_JIT 8
867
868
868
869
/* php_pgsql_get_link_info */
869
870
static void php_pgsql_get_link_info (INTERNAL_FUNCTION_PARAMETERS , int entry_type )
@@ -929,6 +930,25 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type
929
930
PHP_PQ_COPY_PARAM ("application_name" );
930
931
return ;
931
932
}
933
+ case PHP_PG_JIT : {
934
+ PGresult * res ;
935
+ array_init (return_value );
936
+ res = PQexec (pgsql , "SHOW jit_provider" );
937
+ if (PQresultStatus (res ) != PGRES_TUPLES_OK ) {
938
+ add_assoc_null (return_value , "jit_provider" );
939
+ } else {
940
+ add_assoc_string (return_value , "jit_provider" , PQgetvalue (res , 0 , 0 ));
941
+ }
942
+ PQclear (res );
943
+ res = PQexec (pgsql , "SHOW jit" );
944
+ if (PQresultStatus (res ) != PGRES_TUPLES_OK ) {
945
+ add_assoc_null (return_value , "jit" );
946
+ } else {
947
+ add_assoc_string (return_value , "jit" , PQgetvalue (res , 0 , 0 ));
948
+ }
949
+ PQclear (res );
950
+ return ;
951
+ }
932
952
EMPTY_SWITCH_DEFAULT_CASE ()
933
953
}
934
954
if (result ) {
@@ -980,6 +1000,11 @@ PHP_FUNCTION(pg_version)
980
1000
php_pgsql_get_link_info (INTERNAL_FUNCTION_PARAM_PASSTHRU ,PHP_PG_VERSION );
981
1001
}
982
1002
1003
+ PHP_FUNCTION (pg_jit )
1004
+ {
1005
+ php_pgsql_get_link_info (INTERNAL_FUNCTION_PARAM_PASSTHRU ,PHP_PG_JIT );
1006
+ }
1007
+
983
1008
/* Returns the value of a server parameter */
984
1009
PHP_FUNCTION (pg_parameter_status )
985
1010
{
0 commit comments