From 43c601467082d0cc7b3c5df9a9eaec71cd521cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Wed, 23 Sep 2026 02:56:08 +0000 Subject: [PATCH] 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 --- NEWS | 1 + UPGRADING | 1 - ext/pgsql/config.m4 | 3 --- ext/pgsql/pgsql.c | 14 -------------- ext/pgsql/pgsql.stub.php | 3 --- ext/pgsql/pgsql_arginfo.h | 14 +------------- ext/pgsql/tests/pg_service.phpt | 19 ------------------- 7 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 ext/pgsql/tests/pg_service.phpt diff --git a/NEWS b/NEWS index a23aba2642b..75cc315653f 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 50754b27943..1b8ca8b0028 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 1409f879b52..48fbbae34ac 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 16e8589219b..fdf194969d2 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 e9f200e48d0..9bd78eb3ad4 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -508,9 +508,6 @@ namespace { */ 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 6ef2e943b89..c9b0c85880d 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 0ce1be7285e..00000000000 --- a/ext/pgsql/tests/pg_service.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -PostgreSQL connection service field support ---EXTENSIONS-- -pgsql ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(%d) "%A"