PGSQL and POD_SQL: don't include pg_config.h

Even if that header file is available, we better consider it private,
and don't include it.  The information about whether SSL support is
enabled is now missing (`USE_(OPEN)SSL`), and it seems there is no
alternative way to get it (`PQinitSSL()` is always defined), so we
remove it from the PHP info.  Furthermore, the `PG_VERSION` and
`PG_VERSION_STR` macros are no longer available, but as of libpq 9.1
there is `PQlibVersion()` which allows us to construct `PG_VERSION` in
a most likely backwards compatible manner.  The additional information
available through `PG_VERSION_STR` is lost, though, so we define
`PGSQL_LIBPQ_VERSION_STR` basically as alias of `PGSQL_LIBPQ_VERSION`,
and deprecate it right away.

Since we are now requiring at least libpq 9.1, we can remove some
further compatibility code and additional checks.

Regarding the raised requirements: official support for PostGreSQL 9.0
ended on 2015-10-08, and even CentOS 7 already has PostGreSQL 9.2, so
this is not supposed to be too much of an issue.
This commit is contained in:
Christoph M. Becker 2020-05-25 09:00:32 +02:00
parent f3efb9e3fb
commit ce668c0ec6
11 changed files with 77 additions and 193 deletions

View file

@ -26,11 +26,6 @@
#include "php_pdo_pgsql.h"
#include "php_pdo_pgsql_int.h"
#ifdef HAVE_PG_CONFIG_H
#undef SIZEOF_OFF_T
#include <pg_config.h>
#endif
/* {{{ pdo_pgsql_functions[] */
static const zend_function_entry pdo_pgsql_functions[] = {
PHP_FE_END
@ -96,11 +91,12 @@ PHP_MSHUTDOWN_FUNCTION(pdo_pgsql)
*/
PHP_MINFO_FUNCTION(pdo_pgsql)
{
char buf[16];
php_info_print_table_start();
php_info_print_table_row(2, "PDO Driver for PostgreSQL", "enabled");
#ifdef HAVE_PG_CONFIG_H
php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION);
#endif
pdo_libpq_version(buf, sizeof(buf));
php_info_print_table_row(2, "PostgreSQL(libpq) Version", buf);
php_info_print_table_end();
}
/* }}} */