Lines Matching refs:pgsql

115 ZEND_DECLARE_MODULE_GLOBALS(pgsql)
116 static PHP_GINIT_FUNCTION(pgsql);
123 PHP_MINIT(pgsql),
124 PHP_MSHUTDOWN(pgsql),
125 PHP_RINIT(pgsql),
126 PHP_RSHUTDOWN(pgsql),
127 PHP_MINFO(pgsql),
129 PHP_MODULE_GLOBALS(pgsql),
130 PHP_GINIT(pgsql),
141 ZEND_GET_MODULE(pgsql)
291 #define PHP_PQ_ERROR(text, pgsql) { \ argument
292 zend_string *msgbuf = _php_pgsql_trim_message(PQerrorMessage(pgsql)); \
419 static PHP_GINIT_FUNCTION(pgsql) in PHP_INI_END()
442 PHP_MINIT_FUNCTION(pgsql) in PHP_MINIT_FUNCTION() argument
486 PHP_MSHUTDOWN_FUNCTION(pgsql) in PHP_MSHUTDOWN_FUNCTION() argument
494 PHP_RINIT_FUNCTION(pgsql) in PHP_RINIT_FUNCTION() argument
503 PHP_RSHUTDOWN_FUNCTION(pgsql) in PHP_RSHUTDOWN_FUNCTION() argument
517 PHP_MINFO_FUNCTION(pgsql) in PHP_MINFO_FUNCTION() argument
543 PGconn *pgsql; in php_pgsql_do_connect() local
577 pgsql = PQconnectdb(connstring); in php_pgsql_do_connect()
578 if (pgsql == NULL || PQstatus(pgsql) == CONNECTION_BAD) { in php_pgsql_do_connect()
579 PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql) in php_pgsql_do_connect()
580 if (pgsql) { in php_pgsql_do_connect()
581 PQfinish(pgsql); in php_pgsql_do_connect()
587 …if (zend_register_persistent_resource(ZSTR_VAL(str.s), ZSTR_LEN(str.s), pgsql, le_plink) == NULL) { in php_pgsql_do_connect()
617 pgsql = (PGconn *) le->ptr; in php_pgsql_do_connect()
619 …if (PQprotocolVersion(pgsql) >= 3 && zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL)… in php_pgsql_do_connect()
620 pg_result = PQexec(pgsql, "RESET ALL;"); in php_pgsql_do_connect()
627 link->conn = pgsql; in php_pgsql_do_connect()
653 pgsql = PQconnectStart(connstring); in php_pgsql_do_connect()
654 if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { in php_pgsql_do_connect()
655 PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql); in php_pgsql_do_connect()
656 if (pgsql) { in php_pgsql_do_connect()
657 PQfinish(pgsql); in php_pgsql_do_connect()
662 pgsql = PQconnectdb(connstring); in php_pgsql_do_connect()
663 if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { in php_pgsql_do_connect()
664 PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql); in php_pgsql_do_connect()
665 if (pgsql) { in php_pgsql_do_connect()
666 PQfinish(pgsql); in php_pgsql_do_connect()
674 link->conn = pgsql; in php_pgsql_do_connect()
691 PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, link); in php_pgsql_do_connect()
717 PGconn *pgsql; in PHP_FUNCTION() local
726 pgsql = pgsql_handle->conn; in PHP_FUNCTION()
728 ret = PQconnectPoll(pgsql); in PHP_FUNCTION()
785 PGconn *pgsql; in php_pgsql_get_link_info() local
800 pgsql = link->conn; in php_pgsql_get_link_info()
804 result = PQdb(pgsql); in php_pgsql_get_link_info()
807 RETURN_STR(_php_pgsql_trim_message(PQerrorMessage(pgsql))); in php_pgsql_get_link_info()
809 result = PQoptions(pgsql); in php_pgsql_get_link_info()
812 result = PQport(pgsql); in php_pgsql_get_link_info()
815 result = PQtty(pgsql); in php_pgsql_get_link_info()
818 result = PQhost(pgsql); in php_pgsql_get_link_info()
823 add_assoc_long(return_value, "protocol", PQprotocolVersion(pgsql)); in php_pgsql_get_link_info()
824 if (PQprotocolVersion(pgsql) >= 3) { in php_pgsql_get_link_info()
827 add_assoc_string(return_value, "server", (char*)PQparameterStatus(pgsql, "server_version")); in php_pgsql_get_link_info()
829 #define PHP_PQ_COPY_PARAM(_x) tmp = (char*)PQparameterStatus(pgsql, _x); \ in php_pgsql_get_link_info()
901 PGconn *pgsql; in PHP_FUNCTION() local
917 pgsql = link->conn; in PHP_FUNCTION()
919 param = (char*)PQparameterStatus(pgsql, param); in PHP_FUNCTION()
931 PGconn *pgsql; in PHP_FUNCTION() local
947 pgsql = link->conn; in PHP_FUNCTION()
950 res = PQexec(pgsql, "SELECT 1;"); in PHP_FUNCTION()
954 if (PQstatus(pgsql) == CONNECTION_OK) in PHP_FUNCTION()
958 PQreset(pgsql); in PHP_FUNCTION()
959 if (PQstatus(pgsql) == CONNECTION_OK) { in PHP_FUNCTION()
973 PGconn *pgsql; in PHP_FUNCTION() local
991 pgsql = link->conn; in PHP_FUNCTION()
993 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
997 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1004 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
1005 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1007 PQreset(pgsql); in PHP_FUNCTION()
1008 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
1014 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1022 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1031 pg_result->conn = pgsql; in PHP_FUNCTION()
1066 PGconn *pgsql; in PHP_FUNCTION() local
1085 pgsql = link->conn; in PHP_FUNCTION()
1087 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1091 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1121 pgsql_result = PQexecParams(pgsql, query, num_params, in PHP_FUNCTION()
1123 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1125 PQreset(pgsql); in PHP_FUNCTION()
1126 pgsql_result = PQexecParams(pgsql, query, num_params, in PHP_FUNCTION()
1133 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1143 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1152 pg_result->conn = pgsql; in PHP_FUNCTION()
1170 PGconn *pgsql; in PHP_FUNCTION() local
1190 pgsql = link->conn; in PHP_FUNCTION()
1192 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1196 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1203 pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL); in PHP_FUNCTION()
1204 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1206 PQreset(pgsql); in PHP_FUNCTION()
1207 pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL); in PHP_FUNCTION()
1213 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1221 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1230 pg_result->conn = pgsql; in PHP_FUNCTION()
1251 PGconn *pgsql; in PHP_FUNCTION() local
1271 pgsql = link->conn; in PHP_FUNCTION()
1273 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1277 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1306 pgsql_result = PQexecPrepared(pgsql, stmtname, num_params, in PHP_FUNCTION()
1308 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1310 PQreset(pgsql); in PHP_FUNCTION()
1311 pgsql_result = PQexecPrepared(pgsql, stmtname, num_params, in PHP_FUNCTION()
1318 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1328 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1337 pg_result->conn = pgsql; in PHP_FUNCTION()
1456 static zend_string *get_field_name(PGconn *pgsql, Oid oid) in get_field_name() argument
1464 PGresult *result = PQexec(pgsql, "select oid,typname from pg_type"); in get_field_name()
2153 PGconn *pgsql; in PHP_FUNCTION() local
2170 pgsql = link->conn; in PHP_FUNCTION()
2183 PQtrace(pgsql, fp); in PHP_FUNCTION()
2192 PGconn *pgsql; in PHP_FUNCTION() local
2207 pgsql = link->conn; in PHP_FUNCTION()
2209 PQuntrace(pgsql); in PHP_FUNCTION()
2218 PGconn *pgsql; in PHP_FUNCTION() local
2243 pgsql = link->conn; in PHP_FUNCTION()
2267 if ((pgsql_oid = lo_create(pgsql, wanted_oid)) == InvalidOid) { in PHP_FUNCTION()
2275 if ((pgsql_oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == InvalidOid) { in PHP_FUNCTION()
2290 PGconn *pgsql; in PHP_FUNCTION() local
2338 pgsql = link->conn; in PHP_FUNCTION()
2340 if (lo_unlink(pgsql, oid) == -1) { in PHP_FUNCTION()
2355 PGconn *pgsql; in PHP_FUNCTION() local
2408 pgsql = link->conn; in PHP_FUNCTION()
2431 if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { in PHP_FUNCTION()
2433 if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) { in PHP_FUNCTION()
2437 if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { in PHP_FUNCTION()
2438 if (lo_unlink(pgsql, oid) == -1) { in PHP_FUNCTION()
2455 pgsql_lofp->conn = pgsql; in PHP_FUNCTION()
2464 pgLofp *pgsql; in PHP_FUNCTION() local
2470 pgsql = Z_PGSQL_LOB_P(pgsql_lofp); in PHP_FUNCTION()
2471 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2473 if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) { in PHP_FUNCTION()
2474 …php_error_docref(NULL, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->… in PHP_FUNCTION()
2493 pgLofp *pgsql; in PHP_FUNCTION() local
2499 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2500 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2508 if ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, ZSTR_VAL(buf), ZSTR_LEN(buf)))<0) { in PHP_FUNCTION()
2529 pgLofp *pgsql; in PHP_FUNCTION() local
2550 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2551 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2553 if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, ZSTR_VAL(str), len)) == (size_t)-1) { in PHP_FUNCTION()
2568 pgLofp *pgsql; in PHP_FUNCTION() local
2574 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2575 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2578 while ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, buf, PGSQL_LO_READ_BUF_SIZE))>0) { in PHP_FUNCTION()
2591 PGconn *pgsql; in PHP_FUNCTION() local
2613 pgsql = link->conn; in PHP_FUNCTION()
2639 returned_oid = lo_import_with_oid(pgsql, ZSTR_VAL(file_in), wanted_oid); in PHP_FUNCTION()
2648 returned_oid = lo_import(pgsql, ZSTR_VAL(file_in)); in PHP_FUNCTION()
2665 PGconn *pgsql; in PHP_FUNCTION() local
2718 pgsql = link->conn; in PHP_FUNCTION()
2720 if (lo_export(pgsql, oid, ZSTR_VAL(file_out)) == -1) { in PHP_FUNCTION()
2732 pgLofp *pgsql; in PHP_FUNCTION() local
2742 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2743 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2746 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
2747 result = lo_lseek64((PGconn *)pgsql->conn, pgsql->lofd, offset, (int)whence); in PHP_FUNCTION()
2749 result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, (int)offset, (int)whence); in PHP_FUNCTION()
2752 result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, offset, whence); in PHP_FUNCTION()
2767 pgLofp *pgsql; in PHP_FUNCTION() local
2773 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2774 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2777 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
2778 offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
2780 offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
2783 offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
2794 pgLofp *pgsql; in PHP_FUNCTION() local
2801 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2802 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2805 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
2806 result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
2808 result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
2811 result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
2826 PGconn *pgsql; in PHP_FUNCTION() local
2843 pgsql = link->conn; in PHP_FUNCTION()
2846 RETURN_LONG(PQsetErrorVerbosity(pgsql, verbosity)); in PHP_FUNCTION()
2859 PGconn *pgsql; in PHP_FUNCTION() local
2876 pgsql = link->conn; in PHP_FUNCTION()
2878 RETURN_LONG(PQsetClientEncoding(pgsql, encoding)); in PHP_FUNCTION()
2886 PGconn *pgsql; in PHP_FUNCTION() local
2901 pgsql = link->conn; in PHP_FUNCTION()
2905 RETURN_STRING((char *) pg_encoding_to_char(PQclientEncoding(pgsql))); in PHP_FUNCTION()
2913 PGconn *pgsql; in PHP_FUNCTION() local
2929 pgsql = link->conn; in PHP_FUNCTION()
2931 result = PQendcopy(pgsql); in PHP_FUNCTION()
2934 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
2947 PGconn *pgsql; in PHP_FUNCTION() local
2965 pgsql = link->conn; in PHP_FUNCTION()
2967 result = PQputline(pgsql, query); in PHP_FUNCTION()
2969 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
2987 PGconn *pgsql; in PHP_FUNCTION() local
3000 pgsql = link->conn; in PHP_FUNCTION()
3015 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3018 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
3027 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
3039 int ret = PQgetCopyData(pgsql, &csv, 0); in PHP_FUNCTION()
3046 PHP_PQ_ERROR("getline failed: %s", pgsql); in PHP_FUNCTION()
3055 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3065 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3084 PGconn *pgsql; in PHP_FUNCTION() local
3096 pgsql = link->conn; in PHP_FUNCTION()
3110 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3113 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
3123 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
3141 if (PQputCopyData(pgsql, query, (int)strlen(query)) != 1) { in PHP_FUNCTION()
3144 PHP_PQ_ERROR("copy failed: %s", pgsql); in PHP_FUNCTION()
3151 if (PQputCopyEnd(pgsql, NULL) != 1) { in PHP_FUNCTION()
3152 PHP_PQ_ERROR("putcopyend failed: %s", pgsql); in PHP_FUNCTION()
3155 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3157 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3173 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3186 PGconn *pgsql; in PHP_FUNCTION() local
3206 pgsql = link->conn; in PHP_FUNCTION()
3207 ZSTR_LEN(to) = PQescapeStringConn(pgsql, ZSTR_VAL(to), ZSTR_VAL(from), ZSTR_LEN(from), NULL); in PHP_FUNCTION()
3224 PGconn *pgsql; in PHP_FUNCTION() local
3245 pgsql = link->conn; in PHP_FUNCTION()
3246 to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)ZSTR_VAL(from), ZSTR_LEN(from), &to_len); in PHP_FUNCTION()
3280 PGconn *pgsql; in php_pgsql_escape_internal() local
3302 pgsql = link->conn; in php_pgsql_escape_internal()
3305 tmp = PQescapeLiteral(pgsql, ZSTR_VAL(from), ZSTR_LEN(from)); in php_pgsql_escape_internal()
3307 tmp = PQescapeIdentifier(pgsql, ZSTR_VAL(from), ZSTR_LEN(from)); in php_pgsql_escape_internal()
3402 PGconn *pgsql; in PHP_FUNCTION() local
3410 pgsql = link->conn; in PHP_FUNCTION()
3412 RETURN_LONG(PQstatus(pgsql)); in PHP_FUNCTION()
3422 PGconn *pgsql; in PHP_FUNCTION() local
3430 pgsql = link->conn; in PHP_FUNCTION()
3432 RETURN_LONG(PQtransactionStatus(pgsql)); in PHP_FUNCTION()
3442 PGconn *pgsql; in PHP_FUNCTION() local
3450 pgsql = link->conn; in PHP_FUNCTION()
3452 PQreset(pgsql); in PHP_FUNCTION()
3453 if (PQstatus(pgsql) == CONNECTION_BAD) { in PHP_FUNCTION()
3464 static int php_pgsql_flush_query(PGconn *pgsql) in php_pgsql_flush_query() argument
3469 if (PQsetnonblocking(pgsql, 1)) { in php_pgsql_flush_query()
3473 while ((res = PQgetResult(pgsql))) { in php_pgsql_flush_query()
3477 PQsetnonblocking(pgsql, 0); in php_pgsql_flush_query()
3487 PGconn *pgsql; in php_pgsql_do_async() local
3496 pgsql = link->conn; in php_pgsql_do_async()
3498 if (PQsetnonblocking(pgsql, 1)) { in php_pgsql_do_async()
3504 PQconsumeInput(pgsql); in php_pgsql_do_async()
3505 RETVAL_LONG(PQisBusy(pgsql)); in php_pgsql_do_async()
3508 RETVAL_LONG(PQrequestCancel(pgsql)); in php_pgsql_do_async()
3509 while ((pgsql_result = PQgetResult(pgsql))) { in php_pgsql_do_async()
3515 if (PQsetnonblocking(pgsql, 0)) { in php_pgsql_do_async()
3536 static bool _php_pgsql_link_has_results(PGconn *pgsql) /* {{{ */ in _php_pgsql_link_has_results() argument
3539 while ((result = PQgetResult(pgsql))) { in _php_pgsql_link_has_results()
3554 PGconn *pgsql; in PHP_FUNCTION() local
3564 pgsql = link->conn; in PHP_FUNCTION()
3566 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
3568 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
3573 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
3579 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3582 ret = PQflush(pgsql); in PHP_FUNCTION()
3584 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3585 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
3586 PQreset(pgsql); in PHP_FUNCTION()
3588 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3594 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
3602 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
3626 PGconn *pgsql; in PHP_FUNCTION() local
3636 pgsql = link->conn; in PHP_FUNCTION()
3638 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
3640 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
3645 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
3671 …if (PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0)… in PHP_FUNCTION()
3677 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
3678 PQreset(pgsql); in PHP_FUNCTION()
3680 …if (!PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0… in PHP_FUNCTION()
3687 ret = PQflush(pgsql); in PHP_FUNCTION()
3690 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
3698 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
3720 PGconn *pgsql; in PHP_FUNCTION() local
3730 pgsql = link->conn; in PHP_FUNCTION()
3732 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
3734 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
3739 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
3744 if (!PQsendPrepare(pgsql, stmtname, query, 0, NULL)) { in PHP_FUNCTION()
3748 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
3749 PQreset(pgsql); in PHP_FUNCTION()
3751 if (!PQsendPrepare(pgsql, stmtname, query, 0, NULL)) { in PHP_FUNCTION()
3758 ret = PQflush(pgsql); in PHP_FUNCTION()
3761 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
3768 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
3793 PGconn *pgsql; in PHP_FUNCTION() local
3803 pgsql = link->conn; in PHP_FUNCTION()
3805 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
3807 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
3812 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
3840 …if (PQsendQueryPrepared(pgsql, stmtname, num_params, (const char * const *)params, NULL, NULL, 0))… in PHP_FUNCTION()
3846 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
3847 PQreset(pgsql); in PHP_FUNCTION()
3849 …if (!PQsendQueryPrepared(pgsql, stmtname, num_params, (const char * const *)params, NULL, NULL, 0)… in PHP_FUNCTION()
3856 ret = PQflush(pgsql); in PHP_FUNCTION()
3859 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
3866 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
3886 PGconn *pgsql; in PHP_FUNCTION() local
3896 pgsql = link->conn; in PHP_FUNCTION()
3898 pgsql_result = PQgetResult(pgsql); in PHP_FUNCTION()
3906 pg_result->conn = pgsql; in PHP_FUNCTION()
3948 PGconn *pgsql; in PHP_FUNCTION() local
3957 pgsql = link->conn; in PHP_FUNCTION()
3964 PQconsumeInput(pgsql); in PHP_FUNCTION()
3965 pgsql_notify = PQnotifies(pgsql); in PHP_FUNCTION()
3975 …if (PQprotocolVersion(pgsql) >= 3 && zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL)… in PHP_FUNCTION()
3983 …if (PQprotocolVersion(pgsql) >= 3 && zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL)… in PHP_FUNCTION()
3996 PGconn *pgsql; in PHP_FUNCTION() local
4004 pgsql = link->conn; in PHP_FUNCTION()
4006 RETURN_LONG(PQbackendPID(pgsql)); in PHP_FUNCTION()
4036 PGconn *pgsql = (PGconn *) stream->abstract; in php_pgsql_fd_set_option() local
4039 return PQsetnonblocking(pgsql, value); in php_pgsql_fd_set_option()
4048 PGconn *pgsql = (PGconn *) stream->abstract; in php_pgsql_fd_cast() local
4054 int fd_number = PQsocket(pgsql); in php_pgsql_fd_cast()
4077 PGconn *pgsql; in PHP_FUNCTION() local
4085 pgsql = link->conn; in PHP_FUNCTION()
4087 stream = php_stream_alloc(&php_stream_pgsql_fd_ops, pgsql, NULL, "r"); in PHP_FUNCTION()
4103 PGconn *pgsql; in PHP_FUNCTION() local
4111 pgsql = link->conn; in PHP_FUNCTION()
4113 RETURN_BOOL(PQconsumeInput(pgsql)); in PHP_FUNCTION()
4122 PGconn *pgsql; in PHP_FUNCTION() local
4132 pgsql = link->conn; in PHP_FUNCTION()
4134 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4136 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4141 ret = PQflush(pgsql); in PHP_FUNCTION()
4143 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 0) == -1) { in PHP_FUNCTION()
4275 PGconn *pgsql; in PHP_FUNCTION() local
4285 pgsql = link->conn; in PHP_FUNCTION()
4294 if (php_pgsql_meta_data(pgsql, table_name, return_value, extended) == FAILURE) { in PHP_FUNCTION()