Commit 43c60146708 for php
commit 43c601467082d0cc7b3c5df9a9eaec71cd521cf6
Author: 武田 憲太郎 <takeda@youmind.jp>
Date: Wed Sep 23 02:56:08 2026 +0000
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
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 @@ 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 6ef2e943b89..c9b0c85880d 100644
Binary files a/ext/pgsql/pgsql_arginfo.h and b/ext/pgsql/pgsql_arginfo.h differ
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--
-<?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"