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

Function executeQuery

src/bin/pg_dump/pg_dumpall.c:2720–2738  ·  view source on GitHub ↗

* Run a query, return the results, exit program on failure. */

Source from the content-addressed store, hash-verified

2718 * Run a query, return the results, exit program on failure.
2719 */
2720static PGresult *
2721executeQuery(PGconn *conn, const char *query)
2722{
2723 PGresult *res;
2724
2725 pg_log_info("executing %s", query);
2726
2727 res = PQexec(conn, query);
2728 if (!res ||
2729 PQresultStatus(res) != PGRES_TUPLES_OK)
2730 {
2731 pg_log_error("query failed: %s", PQerrorMessage(conn));
2732 pg_log_error("query was: %s", query);
2733 PQfinish(conn);
2734 exit_nicely(1);
2735 }
2736
2737 return res;
2738}
2739
2740/*
2741 * As above for a SQL command (which returns nothing).

Callers 15

dumpResGroupsFunction · 0.70
dumpResQueuesFunction · 0.70
dropRolesFunction · 0.70
dumpRolesFunction · 0.70
dumpRoleMembershipFunction · 0.70
dumpRoleConstraintsFunction · 0.70
dropTablespacesFunction · 0.70
dumpTablespacesFunction · 0.70
dumpTagsFunction · 0.70
dropDBsFunction · 0.70
dumpUserConfigFunction · 0.70
dumpProfilesFunction · 0.70

Calls 5

PQexecFunction · 0.85
PQresultStatusFunction · 0.85
PQerrorMessageFunction · 0.85
PQfinishFunction · 0.85
exit_nicelyFunction · 0.70

Tested by

no test coverage detected