throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Connection not initialized");
} else if (!PQsendQuery(obj->intern->conn, query_str)) {
throw_exce(EX_IO TSRMLS_CC, "Failed to execute query (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#if HAVE_PQSETSINGLEROWMODE
} else if (obj->intern->unbuffered && !PQsetSingleRowMode(obj->intern->conn)) {
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to enable unbuffered mode (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#endif
} else {
php_pq_callback_recurse(&obj->intern->onevent, &resolver TSRMLS_CC);
obj->intern->poller = PQconsumeInput;
if (!rc) {
throw_exce(EX_IO TSRMLS_CC, "Failed to execute query (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#if HAVE_PQSETSINGLEROWMODE
} else if (obj->intern->unbuffered && !PQsetSingleRowMode(obj->intern->conn)) {
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to enable unbuffered mode (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#endif
} else {
php_pq_callback_recurse(&obj->intern->onevent, &resolver TSRMLS_CC);
obj->intern->poller = PQconsumeInput;
if (!PQsendPrepare(obj->intern->conn, name, query, params->type.count, params->type.oids)) {
rv = FAILURE;
throw_exce(EX_IO TSRMLS_CC, "Failed to prepare statement (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#if HAVE_PQSETSINGLEROWMODE
} else if (obj->intern->unbuffered && !PQsetSingleRowMode(obj->intern->conn)) {
rv = FAILURE;
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to enable unbuffered mode (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#endif
} else {
rv = SUCCESS;
obj->intern->poller = PQconsumeInput;
if (!PQsendQuery(obj->intern->conn, decl)) {
rv = FAILURE;
throw_exce(EX_IO TSRMLS_CC, "Failed to declare cursor (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#if HAVE_PQSETSINGLEROWMODE
} else if (obj->intern->unbuffered && !PQsetSingleRowMode(obj->intern->conn)) {
rv = FAILURE;
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to enable unbuffered mode (%s)", PHP_PQerrorMessage(obj->intern->conn));
+#endif
} else {
rv = SUCCESS;
obj->intern->poller = PQconsumeInput;
} else {
PGresult *res;
smart_str cmd = {0};
- const char *il = isolation_level(&isolation);
+ const char *il = php_pq_isolation_level(&isolation);
smart_str_appends(&cmd, "START TRANSACTION ISOLATION LEVEL ");
smart_str_appends(&cmd, il);
throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Connection not initialized");
} else {
smart_str cmd = {0};
- const char *il = isolation_level(&isolation);
+ const char *il = php_pq_isolation_level(&isolation);
smart_str_appends(&cmd, "START TRANSACTION ISOLATION LEVEL ");
smart_str_appends(&cmd, il);