Commit 31962aa086e for php.net

commit 31962aa086e821fd8601d8aa67b58a55f41e77eb
Author: 武田 憲太郎 <takeda@youmind.jp>
Date:   Sat Mar 14 01:08:54 2026 +0000

    ext/pgsql: Enable lo_tell64/lo_truncate64 by removing dead VE_PG_LO64 guards

    The guards reference undefined VE_PG_LO64, a misspelling of
    HAVE_PG_LO64 (removed in GH-14628), making the 64-bit code paths
    permanently dead. Remove the guards to unconditionally enable the
    64-bit variants for PostgreSQL >= 9.3, consistent with pg_lo_seek().

    Dropped from GH-21386 as not suitable for backport.

    close GH-21437

diff --git a/NEWS b/NEWS
index 1f084e98cb3..43f5358ecc8 100644
--- a/NEWS
+++ b/NEWS
@@ -72,6 +72,10 @@ PHP                                                                        NEWS
   . Clear session-local state disconnect-equivalent processing.
     (KentarouTakeda)

+- PGSQL:
+  . Enabled 64 bits support for pg_lo_truncate()/pg_lo_tell()
+    if the server supports it. (KentarouTakeda)
+
 - Phar:
   . Support reference values in Phar::mungServer(). (ndossche)
   . Invalid values now throw in Phar::mungServer() instead of being silently
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 80cade4d760..f50bc680c4b 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3083,15 +3083,11 @@ PHP_FUNCTION(pg_lo_tell)
 	pgsql = Z_PGSQL_LOB_P(pgsql_id);
 	CHECK_PGSQL_LOB(pgsql);

-#ifdef VE_PG_LO64
 	if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
 		offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd);
 	} else {
 		offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
 	}
-#else
-	offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
-#endif
 	RETURN_LONG(offset);
 }
 /* }}} */
@@ -3112,15 +3108,11 @@ PHP_FUNCTION(pg_lo_truncate)
 	pgsql = Z_PGSQL_LOB_P(pgsql_id);
 	CHECK_PGSQL_LOB(pgsql);

-#ifdef VE_PG_LO64
 	if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
 		result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size);
 	} else {
 		result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
 	}
-#else
-	result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
-#endif
 	if (!result) {
 		RETURN_TRUE;
 	} else {