Lines Matching refs:pgsql

116 ZEND_DECLARE_MODULE_GLOBALS(pgsql)
117 static PHP_GINIT_FUNCTION(pgsql);
130 PHP_MINIT(pgsql),
131 PHP_MSHUTDOWN(pgsql),
132 PHP_RINIT(pgsql),
133 PHP_RSHUTDOWN(pgsql),
134 PHP_MINFO(pgsql),
136 PHP_MODULE_GLOBALS(pgsql),
137 PHP_GINIT(pgsql),
148 ZEND_GET_MODULE(pgsql)
291 #define PHP_PQ_ERROR(text, pgsql) { \ argument
292 zend_string *msgbuf = _php_pgsql_trim_message(PQerrorMessage(pgsql)); \
489 static PHP_GINIT_FUNCTION(pgsql) in PHP_INI_END()
559 PHP_MINIT_FUNCTION(pgsql) in PHP_MINIT_FUNCTION() argument
606 PHP_MSHUTDOWN_FUNCTION(pgsql) in PHP_MSHUTDOWN_FUNCTION() argument
617 PHP_RINIT_FUNCTION(pgsql) in PHP_RINIT_FUNCTION() argument
626 PHP_RSHUTDOWN_FUNCTION(pgsql) in PHP_RSHUTDOWN_FUNCTION() argument
640 PHP_MINFO_FUNCTION(pgsql) in PHP_MINFO_FUNCTION() argument
662 PGconn *pgsql; in php_pgsql_do_connect() local
698 pgsql = PQconnectdb(connstring); in php_pgsql_do_connect()
699 if (pgsql == NULL || PQstatus(pgsql) == CONNECTION_BAD) { in php_pgsql_do_connect()
700 PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql) in php_pgsql_do_connect()
701 if (pgsql) { in php_pgsql_do_connect()
702 PQfinish(pgsql); in php_pgsql_do_connect()
708 …if (zend_register_persistent_resource(ZSTR_VAL(str.s), ZSTR_LEN(str.s), pgsql, le_plink) == NULL) { in php_pgsql_do_connect()
746 pgsql = (PGconn *) le->ptr; in php_pgsql_do_connect()
748 if (zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 7.2) { in php_pgsql_do_connect()
749 pg_result = PQexec(pgsql, "RESET ALL;"); in php_pgsql_do_connect()
756 link->conn = pgsql; in php_pgsql_do_connect()
782 pgsql = PQconnectStart(connstring); in php_pgsql_do_connect()
783 if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { in php_pgsql_do_connect()
784 PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql); in php_pgsql_do_connect()
785 if (pgsql) { in php_pgsql_do_connect()
786 PQfinish(pgsql); in php_pgsql_do_connect()
791 pgsql = PQconnectdb(connstring); in php_pgsql_do_connect()
792 if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { in php_pgsql_do_connect()
793 PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql); in php_pgsql_do_connect()
794 if (pgsql) { in php_pgsql_do_connect()
795 PQfinish(pgsql); in php_pgsql_do_connect()
803 link->conn = pgsql; in php_pgsql_do_connect()
820 PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, link); in php_pgsql_do_connect()
846 PGconn *pgsql; in PHP_FUNCTION() local
855 pgsql = pgsql_handle->conn; in PHP_FUNCTION()
857 ret = PQconnectPoll(pgsql); in PHP_FUNCTION()
916 PGconn *pgsql; in php_pgsql_get_link_info() local
932 pgsql = link->conn; in php_pgsql_get_link_info()
936 result = PQdb(pgsql); in php_pgsql_get_link_info()
939 RETURN_STR(_php_pgsql_trim_message(PQerrorMessage(pgsql))); in php_pgsql_get_link_info()
941 result = PQoptions(pgsql); in php_pgsql_get_link_info()
944 result = PQport(pgsql); in php_pgsql_get_link_info()
947 result = PQtty(pgsql); in php_pgsql_get_link_info()
950 result = PQhost(pgsql); in php_pgsql_get_link_info()
956 add_assoc_long(return_value, "protocol", PQprotocolVersion(pgsql)); in php_pgsql_get_link_info()
957 add_assoc_string(return_value, "server", (char*)PQparameterStatus(pgsql, "server_version")); in php_pgsql_get_link_info()
959 #define PHP_PQ_COPY_PARAM(_x) tmp = (char*)PQparameterStatus(pgsql, _x); \ in php_pgsql_get_link_info()
978 res = PQexec(pgsql, "SHOW jit_provider"); in php_pgsql_get_link_info()
985 res = PQexec(pgsql, "SHOW jit"); in php_pgsql_get_link_info()
1055 PGconn *pgsql; in PHP_FUNCTION() local
1071 pgsql = link->conn; in PHP_FUNCTION()
1073 param = (char*)PQparameterStatus(pgsql, param); in PHP_FUNCTION()
1085 PGconn *pgsql; in PHP_FUNCTION() local
1102 pgsql = link->conn; in PHP_FUNCTION()
1105 res = PQexec(pgsql, "SELECT 1;"); in PHP_FUNCTION()
1109 if (PQstatus(pgsql) == CONNECTION_OK) in PHP_FUNCTION()
1113 PQreset(pgsql); in PHP_FUNCTION()
1114 if (PQstatus(pgsql) == CONNECTION_OK) { in PHP_FUNCTION()
1128 PGconn *pgsql; in PHP_FUNCTION() local
1149 pgsql = link->conn; in PHP_FUNCTION()
1151 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1155 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1162 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
1163 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1165 PQreset(pgsql); in PHP_FUNCTION()
1166 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
1172 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1180 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1189 pg_result->conn = pgsql; in PHP_FUNCTION()
1224 PGconn *pgsql; in PHP_FUNCTION() local
1248 pgsql = link->conn; in PHP_FUNCTION()
1250 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1254 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1284 pgsql_result = PQexecParams(pgsql, query, num_params, in PHP_FUNCTION()
1286 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1288 PQreset(pgsql); in PHP_FUNCTION()
1289 pgsql_result = PQexecParams(pgsql, query, num_params, in PHP_FUNCTION()
1296 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1306 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1315 pg_result->conn = pgsql; in PHP_FUNCTION()
1333 PGconn *pgsql; in PHP_FUNCTION() local
1358 pgsql = link->conn; in PHP_FUNCTION()
1360 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1364 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1371 pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL); in PHP_FUNCTION()
1372 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1374 PQreset(pgsql); in PHP_FUNCTION()
1375 pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL); in PHP_FUNCTION()
1381 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1389 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1398 pg_result->conn = pgsql; in PHP_FUNCTION()
1419 PGconn *pgsql; in PHP_FUNCTION() local
1444 pgsql = link->conn; in PHP_FUNCTION()
1446 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1450 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1479 pgsql_result = PQexecPrepared(pgsql, stmtname, num_params, in PHP_FUNCTION()
1481 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1483 PQreset(pgsql); in PHP_FUNCTION()
1484 pgsql_result = PQexecPrepared(pgsql, stmtname, num_params, in PHP_FUNCTION()
1491 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1501 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1510 pg_result->conn = pgsql; in PHP_FUNCTION()
1631 static zend_string *get_field_name(PGconn *pgsql, Oid oid) in get_field_name() argument
1639 PGresult *result = PQexec(pgsql, "select oid,typname from pg_type"); in get_field_name()
2361 PGconn *pgsql; in PHP_FUNCTION() local
2382 pgsql = link->conn; in PHP_FUNCTION()
2395 PQtrace(pgsql, fp); in PHP_FUNCTION()
2402 PQsetTraceFlags(pgsql, trace_mode); in PHP_FUNCTION()
2417 PGconn *pgsql; in PHP_FUNCTION() local
2433 pgsql = link->conn; in PHP_FUNCTION()
2435 PQuntrace(pgsql); in PHP_FUNCTION()
2444 PGconn *pgsql; in PHP_FUNCTION() local
2471 pgsql = link->conn; in PHP_FUNCTION()
2495 if ((pgsql_oid = lo_create(pgsql, wanted_oid)) == InvalidOid) { in PHP_FUNCTION()
2503 if ((pgsql_oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == InvalidOid) { in PHP_FUNCTION()
2518 PGconn *pgsql; in PHP_FUNCTION() local
2566 pgsql = link->conn; in PHP_FUNCTION()
2568 if (lo_unlink(pgsql, oid) == -1) { in PHP_FUNCTION()
2583 PGconn *pgsql; in PHP_FUNCTION() local
2636 pgsql = link->conn; in PHP_FUNCTION()
2659 if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { in PHP_FUNCTION()
2661 if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) { in PHP_FUNCTION()
2665 if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { in PHP_FUNCTION()
2666 if (lo_unlink(pgsql, oid) == -1) { in PHP_FUNCTION()
2683 pgsql_lofp->conn = pgsql; in PHP_FUNCTION()
2692 pgLofp *pgsql; in PHP_FUNCTION() local
2698 pgsql = Z_PGSQL_LOB_P(pgsql_lofp); in PHP_FUNCTION()
2699 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2701 if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) { in PHP_FUNCTION()
2702 …php_error_docref(NULL, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->… in PHP_FUNCTION()
2721 pgLofp *pgsql; in PHP_FUNCTION() local
2729 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2730 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2738 if ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, ZSTR_VAL(buf), ZSTR_LEN(buf)))<0) { in PHP_FUNCTION()
2758 pgLofp *pgsql; in PHP_FUNCTION() local
2782 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2783 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2785 if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, ZSTR_VAL(str), len)) == (size_t)-1) { in PHP_FUNCTION()
2800 pgLofp *pgsql; in PHP_FUNCTION() local
2806 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2807 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2810 while ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, buf, PGSQL_LO_READ_BUF_SIZE))>0) { in PHP_FUNCTION()
2823 PGconn *pgsql; in PHP_FUNCTION() local
2845 pgsql = link->conn; in PHP_FUNCTION()
2871 returned_oid = lo_import_with_oid(pgsql, ZSTR_VAL(file_in), wanted_oid); in PHP_FUNCTION()
2880 returned_oid = lo_import(pgsql, ZSTR_VAL(file_in)); in PHP_FUNCTION()
2897 PGconn *pgsql; in PHP_FUNCTION() local
2950 pgsql = link->conn; in PHP_FUNCTION()
2952 if (lo_export(pgsql, oid, ZSTR_VAL(file_out)) == -1) { in PHP_FUNCTION()
2964 pgLofp *pgsql; in PHP_FUNCTION() local
2978 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2979 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2981 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
2982 result = lo_lseek64((PGconn *)pgsql->conn, pgsql->lofd, offset, (int)whence); in PHP_FUNCTION()
2984 result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, (int)offset, (int)whence); in PHP_FUNCTION()
3000 pgLofp *pgsql; in PHP_FUNCTION() local
3006 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
3007 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
3010 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
3011 offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
3013 offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
3016 offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
3027 pgLofp *pgsql; in PHP_FUNCTION() local
3035 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
3036 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
3039 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
3040 result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
3042 result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
3045 result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
3060 PGconn *pgsql; in PHP_FUNCTION() local
3080 pgsql = link->conn; in PHP_FUNCTION()
3083 RETURN_LONG(PQsetErrorVerbosity(pgsql, verbosity)); in PHP_FUNCTION()
3094 PGconn *pgsql; in PHP_FUNCTION() local
3105 pgsql = link->conn; in PHP_FUNCTION()
3108 RETURN_LONG(PQsetErrorContextVisibility(pgsql, visibility)); in PHP_FUNCTION()
3138 PGconn *pgsql; in PHP_FUNCTION() local
3158 pgsql = link->conn; in PHP_FUNCTION()
3160 RETURN_LONG(PQsetClientEncoding(pgsql, encoding)); in PHP_FUNCTION()
3168 PGconn *pgsql; in PHP_FUNCTION() local
3184 pgsql = link->conn; in PHP_FUNCTION()
3188 RETURN_STRING((char *) pg_encoding_to_char(PQclientEncoding(pgsql))); in PHP_FUNCTION()
3196 PGconn *pgsql; in PHP_FUNCTION() local
3213 pgsql = link->conn; in PHP_FUNCTION()
3215 result = PQendcopy(pgsql); in PHP_FUNCTION()
3218 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
3231 PGconn *pgsql; in PHP_FUNCTION() local
3252 pgsql = link->conn; in PHP_FUNCTION()
3254 result = PQputline(pgsql, query); in PHP_FUNCTION()
3256 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
3274 PGconn *pgsql; in PHP_FUNCTION() local
3289 pgsql = link->conn; in PHP_FUNCTION()
3304 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3307 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
3316 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
3328 int ret = PQgetCopyData(pgsql, &csv, 0); in PHP_FUNCTION()
3335 PHP_PQ_ERROR("getline failed: %s", pgsql); in PHP_FUNCTION()
3344 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3354 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3361 static zend_result pgsql_copy_from_query(PGconn *pgsql, PGresult *pgsql_result, zval *value) in pgsql_copy_from_query() argument
3374 if (PQputCopyData(pgsql, ZSTR_VAL(zquery), ZSTR_LEN(zquery)) != 1) { in pgsql_copy_from_query()
3396 PGconn *pgsql; in PHP_FUNCTION() local
3411 pgsql = link->conn; in PHP_FUNCTION()
3425 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3428 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
3438 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
3448 if (pgsql_copy_from_query(pgsql, pgsql_result, value) == FAILURE) { in PHP_FUNCTION()
3449 PHP_PQ_ERROR("copy failed: %s", pgsql); in PHP_FUNCTION()
3465 if (pgsql_copy_from_query(pgsql, pgsql_result, value) == FAILURE) { in PHP_FUNCTION()
3467 PHP_PQ_ERROR("copy failed: %s", pgsql); in PHP_FUNCTION()
3474 if (PQputCopyEnd(pgsql, NULL) != 1) { in PHP_FUNCTION()
3475 PHP_PQ_ERROR("putcopyend failed: %s", pgsql); in PHP_FUNCTION()
3478 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3480 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3496 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3509 PGconn *pgsql; in PHP_FUNCTION() local
3532 pgsql = link->conn; in PHP_FUNCTION()
3533 ZSTR_LEN(to) = PQescapeStringConn(pgsql, ZSTR_VAL(to), ZSTR_VAL(from), ZSTR_LEN(from), NULL); in PHP_FUNCTION()
3550 PGconn *pgsql; in PHP_FUNCTION() local
3574 pgsql = link->conn; in PHP_FUNCTION()
3575 to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)ZSTR_VAL(from), ZSTR_LEN(from), &to_len); in PHP_FUNCTION()
3610 PGconn *pgsql; in php_pgsql_escape_internal() local
3635 pgsql = link->conn; in php_pgsql_escape_internal()
3638 tmp = PQescapeLiteral(pgsql, ZSTR_VAL(from), ZSTR_LEN(from)); in php_pgsql_escape_internal()
3640 tmp = PQescapeIdentifier(pgsql, ZSTR_VAL(from), ZSTR_LEN(from)); in php_pgsql_escape_internal()
3736 PGconn *pgsql; in PHP_FUNCTION() local
3744 pgsql = link->conn; in PHP_FUNCTION()
3746 RETURN_LONG(PQstatus(pgsql)); in PHP_FUNCTION()
3756 PGconn *pgsql; in PHP_FUNCTION() local
3764 pgsql = link->conn; in PHP_FUNCTION()
3766 RETURN_LONG(PQtransactionStatus(pgsql)); in PHP_FUNCTION()
3776 PGconn *pgsql; in PHP_FUNCTION() local
3784 pgsql = link->conn; in PHP_FUNCTION()
3786 PQreset(pgsql); in PHP_FUNCTION()
3787 if (PQstatus(pgsql) == CONNECTION_BAD) { in PHP_FUNCTION()
3798 static int php_pgsql_flush_query(PGconn *pgsql) in php_pgsql_flush_query() argument
3803 if (PQsetnonblocking(pgsql, 1)) { in php_pgsql_flush_query()
3807 while ((res = PQgetResult(pgsql))) { in php_pgsql_flush_query()
3811 PQsetnonblocking(pgsql, 0); in php_pgsql_flush_query()
3821 PGconn *pgsql; in php_pgsql_do_async() local
3830 pgsql = link->conn; in php_pgsql_do_async()
3832 if (PQsetnonblocking(pgsql, 1)) { in php_pgsql_do_async()
3838 PQconsumeInput(pgsql); in php_pgsql_do_async()
3839 RETVAL_LONG(PQisBusy(pgsql)); in php_pgsql_do_async()
3846 c = PQgetCancel(pgsql); in php_pgsql_do_async()
3851 while ((pgsql_result = PQgetResult(pgsql))) { in php_pgsql_do_async()
3859 if (PQsetnonblocking(pgsql, 0)) { in php_pgsql_do_async()
3880 static bool _php_pgsql_link_has_results(PGconn *pgsql) /* {{{ */ in _php_pgsql_link_has_results() argument
3883 while ((result = PQgetResult(pgsql))) { in _php_pgsql_link_has_results()
3898 PGconn *pgsql; in PHP_FUNCTION() local
3909 pgsql = link->conn; in PHP_FUNCTION()
3911 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
3913 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
3918 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
3924 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3927 ret = PQflush(pgsql); in PHP_FUNCTION()
3929 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3930 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
3931 PQreset(pgsql); in PHP_FUNCTION()
3933 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3939 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
3947 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
3971 PGconn *pgsql; in PHP_FUNCTION() local
3983 pgsql = link->conn; in PHP_FUNCTION()
3985 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
3987 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
3992 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
4018 …if (PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0)… in PHP_FUNCTION()
4024 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
4025 PQreset(pgsql); in PHP_FUNCTION()
4027 …if (!PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0… in PHP_FUNCTION()
4034 ret = PQflush(pgsql); in PHP_FUNCTION()
4037 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
4045 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
4067 PGconn *pgsql; in PHP_FUNCTION() local
4079 pgsql = link->conn; in PHP_FUNCTION()
4081 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4083 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4088 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
4093 if (!PQsendPrepare(pgsql, stmtname, query, 0, NULL)) { in PHP_FUNCTION()
4097 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
4098 PQreset(pgsql); in PHP_FUNCTION()
4100 if (!PQsendPrepare(pgsql, stmtname, query, 0, NULL)) { in PHP_FUNCTION()
4107 ret = PQflush(pgsql); in PHP_FUNCTION()
4110 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
4117 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
4142 PGconn *pgsql; in PHP_FUNCTION() local
4154 pgsql = link->conn; in PHP_FUNCTION()
4156 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4158 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4163 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
4191 …if (PQsendQueryPrepared(pgsql, stmtname, num_params, (const char * const *)params, NULL, NULL, 0))… in PHP_FUNCTION()
4197 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
4198 PQreset(pgsql); in PHP_FUNCTION()
4200 …if (!PQsendQueryPrepared(pgsql, stmtname, num_params, (const char * const *)params, NULL, NULL, 0)… in PHP_FUNCTION()
4207 ret = PQflush(pgsql); in PHP_FUNCTION()
4210 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
4217 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
4237 PGconn *pgsql; in PHP_FUNCTION() local
4247 pgsql = link->conn; in PHP_FUNCTION()
4249 pgsql_result = PQgetResult(pgsql); in PHP_FUNCTION()
4257 pg_result->conn = pgsql; in PHP_FUNCTION()
4301 PGconn *pgsql; in PHP_FUNCTION() local
4312 pgsql = link->conn; in PHP_FUNCTION()
4319 PQconsumeInput(pgsql); in PHP_FUNCTION()
4320 pgsql_notify = PQnotifies(pgsql); in PHP_FUNCTION()
4330 if (zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 9.0) { in PHP_FUNCTION()
4338 if (zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 9.0) { in PHP_FUNCTION()
4351 PGconn *pgsql; in PHP_FUNCTION() local
4359 pgsql = link->conn; in PHP_FUNCTION()
4361 RETURN_LONG(PQbackendPID(pgsql)); in PHP_FUNCTION()
4391 PGconn *pgsql = (PGconn *) stream->abstract; in php_pgsql_fd_set_option() local
4394 return PQsetnonblocking(pgsql, value); in php_pgsql_fd_set_option()
4403 PGconn *pgsql = (PGconn *) stream->abstract; in php_pgsql_fd_cast() local
4409 int fd_number = PQsocket(pgsql); in php_pgsql_fd_cast()
4432 PGconn *pgsql; in PHP_FUNCTION() local
4440 pgsql = link->conn; in PHP_FUNCTION()
4442 stream = php_stream_alloc(&php_stream_pgsql_fd_ops, pgsql, NULL, "r"); in PHP_FUNCTION()
4458 PGconn *pgsql; in PHP_FUNCTION() local
4466 pgsql = link->conn; in PHP_FUNCTION()
4468 RETURN_BOOL(PQconsumeInput(pgsql)); in PHP_FUNCTION()
4477 PGconn *pgsql; in PHP_FUNCTION() local
4487 pgsql = link->conn; in PHP_FUNCTION()
4489 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4491 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4496 ret = PQflush(pgsql); in PHP_FUNCTION()
4498 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 0) == -1) { in PHP_FUNCTION()
4631 PGconn *pgsql; in PHP_FUNCTION() local
4642 pgsql = link->conn; in PHP_FUNCTION()
4651 if (php_pgsql_meta_data(pgsql, table_name, return_value, extended) == FAILURE) { in PHP_FUNCTION()