MCPcopy Create free account
hub / github.com/apache/cloudberry / pgfdw_exec_query

Function pgfdw_exec_query

contrib/postgres_fdw/connection.c:682–698  ·  view source on GitHub ↗

* Submit a query and wait for the result. * * This function is interruptible by signals. * * Caller is responsible for the error handling on the result. */

Source from the content-addressed store, hash-verified

680 * Caller is responsible for the error handling on the result.
681 */
682PGresult *
683pgfdw_exec_query(PGconn *conn, const char *query, PgFdwConnState *state)
684{
685 /* First, process a pending asynchronous request, if any. */
686 if (state && state->pendingAreq)
687 process_pending_request(state->pendingAreq);
688
689 /*
690 * Submit a query. Since we don't use non-blocking mode, this also can
691 * block. But its risk is relatively small, so we ignore that for now.
692 */
693 if (!PQsendQuery(conn, query))
694 pgfdw_report_error(ERROR, NULL, conn, false, query);
695
696 /* Wait for the result. */
697 return pgfdw_get_result(conn, query);
698}
699
700/*
701 * Wait for the result from a prior asynchronous execution function call.

Callers 9

get_remote_estimateFunction · 0.85
fetch_more_dataFunction · 0.85
close_cursorFunction · 0.85
deallocate_queryFunction · 0.85

Calls 4

process_pending_requestFunction · 0.85
PQsendQueryFunction · 0.85
pgfdw_report_errorFunction · 0.85
pgfdw_get_resultFunction · 0.85

Tested by

no test coverage detected