summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/php_pdo_pgsql_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_pgsql/php_pdo_pgsql_int.h')
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql_int.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h
index 54a06011a7..565638f705 100644
--- a/ext/pdo_pgsql/php_pdo_pgsql_int.h
+++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h
@@ -22,6 +22,7 @@
#define PHP_PDO_PGSQL_INT_H
#include <libpq-fe.h>
+#include <php.h>
#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006"
@@ -71,6 +72,12 @@ extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const
extern struct pdo_stmt_methods pgsql_stmt_methods;
+#ifdef HAVE_PQRESULTERRORFIELD
+#define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE)
+#else
+#define pdo_pgsql_sqlstate(r) (const char *)NULL
+#endif
+
#endif /* PHP_PDO_PGSQL_INT_H */
/*