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
1152 pgsql = link->conn; in PHP_FUNCTION()
1154 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1158 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1165 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
1166 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1168 PQreset(pgsql); in PHP_FUNCTION()
1169 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
1175 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1183 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1192 pg_result->conn = pgsql; in PHP_FUNCTION()
1227 PGconn *pgsql; in PHP_FUNCTION() local
1254 pgsql = link->conn; in PHP_FUNCTION()
1256 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1260 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1290 pgsql_result = PQexecParams(pgsql, query, num_params, in PHP_FUNCTION()
1292 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1294 PQreset(pgsql); in PHP_FUNCTION()
1295 pgsql_result = PQexecParams(pgsql, query, num_params, in PHP_FUNCTION()
1302 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1312 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1321 pg_result->conn = pgsql; in PHP_FUNCTION()
1339 PGconn *pgsql; in PHP_FUNCTION() local
1367 pgsql = link->conn; in PHP_FUNCTION()
1369 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1373 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1380 pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL); in PHP_FUNCTION()
1381 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1383 PQreset(pgsql); in PHP_FUNCTION()
1384 pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL); in PHP_FUNCTION()
1390 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1398 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1407 pg_result->conn = pgsql; in PHP_FUNCTION()
1428 PGconn *pgsql; in PHP_FUNCTION() local
1456 pgsql = link->conn; in PHP_FUNCTION()
1458 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
1462 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
1491 pgsql_result = PQexecPrepared(pgsql, stmtname, num_params, in PHP_FUNCTION()
1493 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
1495 PQreset(pgsql); in PHP_FUNCTION()
1496 pgsql_result = PQexecPrepared(pgsql, stmtname, num_params, in PHP_FUNCTION()
1503 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
1513 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
1522 pg_result->conn = pgsql; in PHP_FUNCTION()
1643 static zend_string *get_field_name(PGconn *pgsql, Oid oid) in get_field_name() argument
1651 PGresult *result = PQexec(pgsql, "select oid,typname from pg_type"); in get_field_name()
2379 PGconn *pgsql; in PHP_FUNCTION() local
2400 pgsql = link->conn; in PHP_FUNCTION()
2413 PQtrace(pgsql, fp); in PHP_FUNCTION()
2420 PQsetTraceFlags(pgsql, trace_mode); in PHP_FUNCTION()
2435 PGconn *pgsql; in PHP_FUNCTION() local
2451 pgsql = link->conn; in PHP_FUNCTION()
2453 PQuntrace(pgsql); in PHP_FUNCTION()
2462 PGconn *pgsql; in PHP_FUNCTION() local
2489 pgsql = link->conn; in PHP_FUNCTION()
2513 if ((pgsql_oid = lo_create(pgsql, wanted_oid)) == InvalidOid) { in PHP_FUNCTION()
2521 if ((pgsql_oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == InvalidOid) { in PHP_FUNCTION()
2536 PGconn *pgsql; in PHP_FUNCTION() local
2584 pgsql = link->conn; in PHP_FUNCTION()
2586 if (lo_unlink(pgsql, oid) == -1) { in PHP_FUNCTION()
2601 PGconn *pgsql; in PHP_FUNCTION() local
2654 pgsql = link->conn; in PHP_FUNCTION()
2677 if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { in PHP_FUNCTION()
2679 if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) { in PHP_FUNCTION()
2683 if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { in PHP_FUNCTION()
2684 if (lo_unlink(pgsql, oid) == -1) { in PHP_FUNCTION()
2701 pgsql_lofp->conn = pgsql; in PHP_FUNCTION()
2710 pgLofp *pgsql; in PHP_FUNCTION() local
2716 pgsql = Z_PGSQL_LOB_P(pgsql_lofp); in PHP_FUNCTION()
2717 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2719 if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) { in PHP_FUNCTION()
2720 …php_error_docref(NULL, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->… in PHP_FUNCTION()
2739 pgLofp *pgsql; in PHP_FUNCTION() local
2747 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2748 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2756 if ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, ZSTR_VAL(buf), ZSTR_LEN(buf)))<0) { in PHP_FUNCTION()
2776 pgLofp *pgsql; in PHP_FUNCTION() local
2800 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2801 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2803 if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, ZSTR_VAL(str), len)) == (size_t)-1) { in PHP_FUNCTION()
2818 pgLofp *pgsql; in PHP_FUNCTION() local
2824 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2825 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2828 while ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, buf, PGSQL_LO_READ_BUF_SIZE))>0) { in PHP_FUNCTION()
2841 PGconn *pgsql; in PHP_FUNCTION() local
2863 pgsql = link->conn; in PHP_FUNCTION()
2889 returned_oid = lo_import_with_oid(pgsql, ZSTR_VAL(file_in), wanted_oid); in PHP_FUNCTION()
2898 returned_oid = lo_import(pgsql, ZSTR_VAL(file_in)); in PHP_FUNCTION()
2915 PGconn *pgsql; in PHP_FUNCTION() local
2968 pgsql = link->conn; in PHP_FUNCTION()
2970 if (lo_export(pgsql, oid, ZSTR_VAL(file_out)) == -1) { in PHP_FUNCTION()
2982 pgLofp *pgsql; in PHP_FUNCTION() local
2996 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
2997 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
2999 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
3000 result = lo_lseek64((PGconn *)pgsql->conn, pgsql->lofd, offset, (int)whence); in PHP_FUNCTION()
3002 result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, (int)offset, (int)whence); in PHP_FUNCTION()
3018 pgLofp *pgsql; in PHP_FUNCTION() local
3024 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
3025 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
3028 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
3029 offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
3031 offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
3034 offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); in PHP_FUNCTION()
3045 pgLofp *pgsql; in PHP_FUNCTION() local
3053 pgsql = Z_PGSQL_LOB_P(pgsql_id); in PHP_FUNCTION()
3054 CHECK_PGSQL_LOB(pgsql); in PHP_FUNCTION()
3057 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { in PHP_FUNCTION()
3058 result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
3060 result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
3063 result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); in PHP_FUNCTION()
3078 PGconn *pgsql; in PHP_FUNCTION() local
3101 pgsql = link->conn; in PHP_FUNCTION()
3104 RETURN_LONG(PQsetErrorVerbosity(pgsql, verbosity)); in PHP_FUNCTION()
3115 PGconn *pgsql; in PHP_FUNCTION() local
3126 pgsql = link->conn; in PHP_FUNCTION()
3129 RETURN_LONG(PQsetErrorContextVisibility(pgsql, visibility)); in PHP_FUNCTION()
3159 PGconn *pgsql; in PHP_FUNCTION() local
3182 pgsql = link->conn; in PHP_FUNCTION()
3184 RETURN_LONG(PQsetClientEncoding(pgsql, encoding)); in PHP_FUNCTION()
3192 PGconn *pgsql; in PHP_FUNCTION() local
3208 pgsql = link->conn; in PHP_FUNCTION()
3212 RETURN_STRING((char *) pg_encoding_to_char(PQclientEncoding(pgsql))); in PHP_FUNCTION()
3220 PGconn *pgsql; in PHP_FUNCTION() local
3237 pgsql = link->conn; in PHP_FUNCTION()
3239 result = PQendcopy(pgsql); in PHP_FUNCTION()
3242 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
3255 PGconn *pgsql; in PHP_FUNCTION() local
3279 pgsql = link->conn; in PHP_FUNCTION()
3281 result = PQputline(pgsql, query); in PHP_FUNCTION()
3283 PHP_PQ_ERROR("Query failed: %s", pgsql); in PHP_FUNCTION()
3301 PGconn *pgsql; in PHP_FUNCTION() local
3316 pgsql = link->conn; in PHP_FUNCTION()
3331 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3334 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
3343 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
3355 int ret = PQgetCopyData(pgsql, &csv, 0); in PHP_FUNCTION()
3362 PHP_PQ_ERROR("getline failed: %s", pgsql); in PHP_FUNCTION()
3371 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3381 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3388 static zend_result pgsql_copy_from_query(PGconn *pgsql, PGresult *pgsql_result, zval *value) in pgsql_copy_from_query() argument
3401 if (PQputCopyData(pgsql, ZSTR_VAL(zquery), ZSTR_LEN(zquery)) != 1) { in pgsql_copy_from_query()
3423 PGconn *pgsql; in PHP_FUNCTION() local
3438 pgsql = link->conn; in PHP_FUNCTION()
3452 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3455 pgsql_result = PQexec(pgsql, query); in PHP_FUNCTION()
3465 status = (ExecStatusType) PQstatus(pgsql); in PHP_FUNCTION()
3475 if (pgsql_copy_from_query(pgsql, pgsql_result, value) == FAILURE) { in PHP_FUNCTION()
3476 PHP_PQ_ERROR("copy failed: %s", pgsql); in PHP_FUNCTION()
3492 if (pgsql_copy_from_query(pgsql, pgsql_result, value) == FAILURE) { in PHP_FUNCTION()
3494 PHP_PQ_ERROR("copy failed: %s", pgsql); in PHP_FUNCTION()
3501 if (PQputCopyEnd(pgsql, NULL) != 1) { in PHP_FUNCTION()
3502 PHP_PQ_ERROR("putcopyend failed: %s", pgsql); in PHP_FUNCTION()
3505 while ((pgsql_result = PQgetResult(pgsql))) { in PHP_FUNCTION()
3507 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3523 PHP_PQ_ERROR("Copy command failed: %s", pgsql); in PHP_FUNCTION()
3536 PGconn *pgsql; in PHP_FUNCTION() local
3559 pgsql = link->conn; in PHP_FUNCTION()
3560 ZSTR_LEN(to) = PQescapeStringConn(pgsql, ZSTR_VAL(to), ZSTR_VAL(from), ZSTR_LEN(from), NULL); in PHP_FUNCTION()
3577 PGconn *pgsql; in PHP_FUNCTION() local
3601 pgsql = link->conn; in PHP_FUNCTION()
3602 to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)ZSTR_VAL(from), ZSTR_LEN(from), &to_len); in PHP_FUNCTION()
3637 PGconn *pgsql; in php_pgsql_escape_internal() local
3662 pgsql = link->conn; in php_pgsql_escape_internal()
3665 tmp = PQescapeLiteral(pgsql, ZSTR_VAL(from), ZSTR_LEN(from)); in php_pgsql_escape_internal()
3667 tmp = PQescapeIdentifier(pgsql, ZSTR_VAL(from), ZSTR_LEN(from)); in php_pgsql_escape_internal()
3763 PGconn *pgsql; in PHP_FUNCTION() local
3771 pgsql = link->conn; in PHP_FUNCTION()
3773 RETURN_LONG(PQstatus(pgsql)); in PHP_FUNCTION()
3783 PGconn *pgsql; in PHP_FUNCTION() local
3791 pgsql = link->conn; in PHP_FUNCTION()
3793 RETURN_LONG(PQtransactionStatus(pgsql)); in PHP_FUNCTION()
3803 PGconn *pgsql; in PHP_FUNCTION() local
3811 pgsql = link->conn; in PHP_FUNCTION()
3813 PQreset(pgsql); in PHP_FUNCTION()
3814 if (PQstatus(pgsql) == CONNECTION_BAD) { in PHP_FUNCTION()
3825 static int php_pgsql_flush_query(PGconn *pgsql) in php_pgsql_flush_query() argument
3830 if (PQsetnonblocking(pgsql, 1)) { in php_pgsql_flush_query()
3834 while ((res = PQgetResult(pgsql))) { in php_pgsql_flush_query()
3838 PQsetnonblocking(pgsql, 0); in php_pgsql_flush_query()
3848 PGconn *pgsql; in php_pgsql_do_async() local
3857 pgsql = link->conn; in php_pgsql_do_async()
3859 if (PQsetnonblocking(pgsql, 1)) { in php_pgsql_do_async()
3865 PQconsumeInput(pgsql); in php_pgsql_do_async()
3866 RETVAL_LONG(PQisBusy(pgsql)); in php_pgsql_do_async()
3873 c = PQgetCancel(pgsql); in php_pgsql_do_async()
3878 while ((pgsql_result = PQgetResult(pgsql))) { in php_pgsql_do_async()
3886 if (PQsetnonblocking(pgsql, 0)) { in php_pgsql_do_async()
3907 static bool _php_pgsql_link_has_results(PGconn *pgsql) /* {{{ */ in _php_pgsql_link_has_results() argument
3910 while ((result = PQgetResult(pgsql))) { in _php_pgsql_link_has_results()
3925 PGconn *pgsql; in PHP_FUNCTION() local
3936 pgsql = link->conn; in PHP_FUNCTION()
3938 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
3940 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
3945 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
3951 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3954 ret = PQflush(pgsql); in PHP_FUNCTION()
3956 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3957 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
3958 PQreset(pgsql); in PHP_FUNCTION()
3960 if (!PQsendQuery(pgsql, query)) { in PHP_FUNCTION()
3966 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
3974 if (PQsetnonblocking(pgsql, 0)) { in PHP_FUNCTION()
3998 PGconn *pgsql; in PHP_FUNCTION() local
4010 pgsql = link->conn; in PHP_FUNCTION()
4012 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4014 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4019 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
4045 …if (PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0)… in PHP_FUNCTION()
4051 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
4052 PQreset(pgsql); in PHP_FUNCTION()
4054 …if (!PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0… in PHP_FUNCTION()
4061 ret = PQflush(pgsql); in PHP_FUNCTION()
4064 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
4072 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
4094 PGconn *pgsql; in PHP_FUNCTION() local
4106 pgsql = link->conn; in PHP_FUNCTION()
4108 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4110 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4115 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
4120 if (!PQsendPrepare(pgsql, stmtname, query, 0, NULL)) { in PHP_FUNCTION()
4124 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
4125 PQreset(pgsql); in PHP_FUNCTION()
4127 if (!PQsendPrepare(pgsql, stmtname, query, 0, NULL)) { in PHP_FUNCTION()
4134 ret = PQflush(pgsql); in PHP_FUNCTION()
4137 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
4144 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
4169 PGconn *pgsql; in PHP_FUNCTION() local
4181 pgsql = link->conn; in PHP_FUNCTION()
4183 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4185 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4190 if (_php_pgsql_link_has_results(pgsql)) { in PHP_FUNCTION()
4218 …if (PQsendQueryPrepared(pgsql, stmtname, num_params, (const char * const *)params, NULL, NULL, 0))… in PHP_FUNCTION()
4224 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { in PHP_FUNCTION()
4225 PQreset(pgsql); in PHP_FUNCTION()
4227 …if (!PQsendQueryPrepared(pgsql, stmtname, num_params, (const char * const *)params, NULL, NULL, 0)… in PHP_FUNCTION()
4234 ret = PQflush(pgsql); in PHP_FUNCTION()
4237 while ((ret = PQflush(pgsql))) { in PHP_FUNCTION()
4244 if (PQsetnonblocking(pgsql, 0) != 0) { in PHP_FUNCTION()
4264 PGconn *pgsql; in PHP_FUNCTION() local
4274 pgsql = link->conn; in PHP_FUNCTION()
4276 pgsql_result = PQgetResult(pgsql); in PHP_FUNCTION()
4284 pg_result->conn = pgsql; in PHP_FUNCTION()
4328 PGconn *pgsql; in PHP_FUNCTION() local
4339 pgsql = link->conn; in PHP_FUNCTION()
4346 PQconsumeInput(pgsql); in PHP_FUNCTION()
4347 pgsql_notify = PQnotifies(pgsql); in PHP_FUNCTION()
4357 if (zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 9.0) { in PHP_FUNCTION()
4365 if (zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 9.0) { in PHP_FUNCTION()
4378 PGconn *pgsql; in PHP_FUNCTION() local
4386 pgsql = link->conn; in PHP_FUNCTION()
4388 RETURN_LONG(PQbackendPID(pgsql)); in PHP_FUNCTION()
4418 PGconn *pgsql = (PGconn *) stream->abstract; in php_pgsql_fd_set_option() local
4421 return PQsetnonblocking(pgsql, value); in php_pgsql_fd_set_option()
4430 PGconn *pgsql = (PGconn *) stream->abstract; in php_pgsql_fd_cast() local
4436 int fd_number = PQsocket(pgsql); in php_pgsql_fd_cast()
4459 PGconn *pgsql; in PHP_FUNCTION() local
4467 pgsql = link->conn; in PHP_FUNCTION()
4469 stream = php_stream_alloc(&php_stream_pgsql_fd_ops, pgsql, NULL, "r"); in PHP_FUNCTION()
4485 PGconn *pgsql; in PHP_FUNCTION() local
4493 pgsql = link->conn; in PHP_FUNCTION()
4495 RETURN_BOOL(PQconsumeInput(pgsql)); in PHP_FUNCTION()
4504 PGconn *pgsql; in PHP_FUNCTION() local
4514 pgsql = link->conn; in PHP_FUNCTION()
4516 is_non_blocking = PQisnonblocking(pgsql); in PHP_FUNCTION()
4518 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 1) == -1) { in PHP_FUNCTION()
4523 ret = PQflush(pgsql); in PHP_FUNCTION()
4525 if (is_non_blocking == 0 && PQsetnonblocking(pgsql, 0) == -1) { in PHP_FUNCTION()
4658 PGconn *pgsql; in PHP_FUNCTION() local
4669 pgsql = link->conn; in PHP_FUNCTION()
4678 if (php_pgsql_meta_data(pgsql, table_name, return_value, extended) == FAILURE) { in PHP_FUNCTION()