diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index b8952521c3020..48fbbae34ace0 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -28,11 +28,6 @@ if test "$PHP_PGSQL" != "no"; then [Define to 1 if libpq has the 'PQsocketPoll' function (PostgreSQL 17 or later).])],, [$PGSQL_LIBS]) - PHP_CHECK_LIBRARY([pq], [PQsetChunkedRowsMode], - [AC_DEFINE([HAVE_PG_SET_CHUNKED_ROWS_SIZE], [1], - [Define to 1 if libpq has the 'PQsetChunkedRowsMode' function (PostgreSQL - 17 or later).])],, - [$PGSQL_LIBS]) PHP_CHECK_LIBRARY([pq], [PQclosePrepared], [AC_DEFINE([HAVE_PG_CLOSE_STMT], [1], [PostgreSQL 17 or later])],, [$PGSQL_LIBS]) @@ -40,6 +35,15 @@ if test "$PHP_PGSQL" != "no"; then old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $PGSQL_CFLAGS" + AC_CHECK_DECLS([PGRES_TUPLES_CHUNK], + PHP_CHECK_LIBRARY([pq], [PQsetChunkedRowsMode], + [AC_DEFINE([HAVE_PG_SET_CHUNKED_ROWS_SIZE], [1], + [Define to 1 if libpq has the 'PQsetChunkedRowsMode' function (PostgreSQL + 17 or later).])],, + [$PGSQL_LIBS]),, + [#include ] + ) + dnl Available since PostgreSQL 12. AC_CACHE_CHECK([if PGVerbosity enum has PQERRORS_SQLSTATE], [php_cv_enum_pgverbosity_pqerrors_sqlstate],