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

Function executeCommand

src/fe_utils/query_utils.c:46–65  ·  view source on GitHub ↗

* As above for a SQL command (which returns nothing). */

Source from the content-addressed store, hash-verified

44 * As above for a SQL command (which returns nothing).
45 */
46void
47executeCommand(PGconn *conn, const char *query, bool echo)
48{
49 PGresult *res;
50
51 if (echo)
52 printf("%s\n", query);
53
54 res = PQexec(conn, query);
55 if (!res ||
56 PQresultStatus(res) != PGRES_COMMAND_OK)
57 {
58 pg_log_error("query failed: %s", PQerrorMessage(conn));
59 pg_log_info("query was: %s", query);
60 PQfinish(conn);
61 exit(1);
62 }
63
64 PQclear(res);
65}
66
67
68/*

Callers 1

connect_slotFunction · 0.70

Calls 5

PQexecFunction · 0.85
PQresultStatusFunction · 0.85
PQerrorMessageFunction · 0.85
PQfinishFunction · 0.85
PQclearFunction · 0.85

Tested by

no test coverage detected