[php-src] master: ext/pgsql: Removed `pg_service()`, unavailable with any released libpq

From: Date: Thu, 24 Sep 2026 03:49:19 +0000
Subject: [php-src] master: ext/pgsql: Removed `pg_service()`, unavailable with any released libpq
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141488@lists.php.net to get a copy of this message
Author: 武田 憲太郎 (KentarouTakeda) Committer: David Carlier (devnexen) Date: 2026-09-24T04:47:49+01:00 Commit: https://github.com/php/php-src/commit/43c601467082d0cc7b3c5df9a9eaec71cd521cf6 Raw diff: https://github.com/php/php-src/commit/43c601467082d0cc7b3c5df9a9eaec71cd521cf6.diff ext/pgsql: Removed pg_service(), unavailable with any released libpq PQservice() never shipped in a released libpq; it was dropped during the PostgreSQL 18 beta. Close GH-23857 Changed paths: D ext/pgsql/tests/pg_service.phpt M NEWS M UPGRADING M ext/pgsql/config.m4 M ext/pgsql/pgsql.c M ext/pgsql/pgsql.stub.php M ext/pgsql/pgsql_arginfo.h Diff: diff --git a/NEWS b/NEWS index a23aba2642b3..75cc315653f1 100644 --- a/NEWS +++ b/NEWS @@ -68,6 +68,7 @@ PHP NEWS - PGSQL: . Fixed pg_lo_write() rejecting data containing null bytes. (Ilia Alshanetsky) + . Removed pg_service(), unavailable with any released libpq. (KentarouTakeda) - Readline: . Fixed a heap over-read in the interactive shell prompt when cli.prompt is diff --git a/UPGRADING b/UPGRADING index 50754b279439..1b8ca8b0028a 100644 --- a/UPGRADING +++ b/UPGRADING @@ -782,7 +782,6 @@ PHP 8.5 UPGRADE NOTES . pg_close_stmt offers an alternative way to close a prepared statement from the DEALLOCATE sql command in that we can reuse its name afterwards. - . pg_service returns the ongoing service name of the connection. - Reflection: . ReflectionConstant::getFileName() was introduced. diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index 1409f879b52c..48fbbae34ace 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -31,9 +31,6 @@ if test "$PHP_PGSQL" != "no"; then PHP_CHECK_LIBRARY([pq], [PQclosePrepared], [AC_DEFINE([HAVE_PG_CLOSE_STMT], [1], [PostgreSQL 17 or later])],, [$PGSQL_LIBS]) - PHP_CHECK_LIBRARY([pq], [PQservice], - [AC_DEFINE([HAVE_PG_SERVICE], [1], [PostgreSQL 18 or later])],, - [$PGSQL_LIBS]) old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $PGSQL_CFLAGS" diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 16e8589219b8..fdf194969d2a 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -922,7 +922,6 @@ PHP_FUNCTION(pg_close) #define PHP_PG_HOST 6 #define PHP_PG_VERSION 7 #define PHP_PG_JIT 8 -#define PHP_PG_SERVICE 9 /* php_pgsql_get_link_info */ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) @@ -1007,12 +1006,6 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type PQclear(res); return; } -#if defined(HAVE_PG_SERVICE) - case PHP_PG_SERVICE: { - result = PQservice(pgsql); - break; - } -#endif EMPTY_SWITCH_DEFAULT_CASE() } if (result) { @@ -1069,13 +1062,6 @@ PHP_FUNCTION(pg_jit) php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_JIT); } -#if defined(HAVE_PG_SERVICE) -PHP_FUNCTION(pg_service) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_SERVICE); -} -#endif - /* Returns the value of a server parameter */ PHP_FUNCTION(pg_parameter_status) { diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index e9f200e48d0a..9bd78eb3ad4f 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -508,9 +508,6 @@ function pg_version(?PgSql\Connection $connection = null): array {} */ function pg_jit(?PgSql\Connection $connection = null): array {} -#ifdef HAVE_PG_SERVICE - function pg_service(?PgSql\Connection $connection = null): string {} -#endif /** * @param PgSql\Connection|string $connection * @refcount 1 diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h index 6ef2e943b893..c9b0c85880da 100644 --- a/ext/pgsql/pgsql_arginfo.h +++ b/ext/pgsql/pgsql_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 778fedc7b65675b54f3c1b42205920478bf49fbf */ + * Stub hash: 368fabe2efd0e7d490ca80ecab0d92c4d5381e5e */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pg_connect, 0, 1, PgSql\\Connection, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0) @@ -38,12 +38,6 @@ ZEND_END_ARG_INFO() #define arginfo_pg_jit arginfo_pg_version -#if defined(HAVE_PG_SERVICE) -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_service, 0, 0, IS_STRING, 0) - ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, connection, PgSql\\Connection, 1, "null") -ZEND_END_ARG_INFO() -#endif - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_parameter_status, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, connection) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) @@ -520,9 +514,6 @@ ZEND_FUNCTION(pg_tty); ZEND_FUNCTION(pg_host); ZEND_FUNCTION(pg_version); ZEND_FUNCTION(pg_jit); -#if defined(HAVE_PG_SERVICE) -ZEND_FUNCTION(pg_service); -#endif ZEND_FUNCTION(pg_parameter_status); ZEND_FUNCTION(pg_ping); ZEND_FUNCTION(pg_query); @@ -632,9 +623,6 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(pg_host, arginfo_pg_host) ZEND_FE(pg_version, arginfo_pg_version) ZEND_FE(pg_jit, arginfo_pg_jit) -#if defined(HAVE_PG_SERVICE) - ZEND_FE(pg_service, arginfo_pg_service) -#endif ZEND_FE(pg_parameter_status, arginfo_pg_parameter_status) ZEND_FE(pg_ping, arginfo_pg_ping) ZEND_FE(pg_query, arginfo_pg_query) diff --git a/ext/pgsql/tests/pg_service.phpt b/ext/pgsql/tests/pg_service.phpt deleted file mode 100644 index 0ce1be7285eb..000000000000 --- a/ext/pgsql/tests/pg_service.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -PostgreSQL connection service field support ---EXTENSIONS-- -pgsql ---SKIPIF-- -<?php -include("inc/skipif.inc"); -if (!function_exists("pg_service")) die("skip pg_service unsupported"); -?> ---FILE-- -<?php -include('inc/config.inc'); - -$db = pg_connect($conn_str); -var_dump(pg_service($db)); -pg_close($db); -?> ---EXPECTF-- -string(%d) "%A"

« previous php.cvs (#141488) next »