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

Function minimal_error_message

src/bin/psql/command.c:5406–5429  ·  view source on GitHub ↗

* Report just the primary error; this is to avoid cluttering the output * with, for instance, a redisplay of the internally generated query */

Source from the content-addressed store, hash-verified

5404 * with, for instance, a redisplay of the internally generated query
5405 */
5406static void
5407minimal_error_message(PGresult *res)
5408{
5409 PQExpBuffer msg;
5410 const char *fld;
5411
5412 msg = createPQExpBuffer();
5413
5414 fld = PQresultErrorField(res, PG_DIAG_SEVERITY);
5415 if (fld)
5416 printfPQExpBuffer(msg, "%s: ", fld);
5417 else
5418 printfPQExpBuffer(msg, "ERROR: ");
5419 fld = PQresultErrorField(res, PG_DIAG_MESSAGE_PRIMARY);
5420 if (fld)
5421 appendPQExpBufferStr(msg, fld);
5422 else
5423 appendPQExpBufferStr(msg, "(not available)");
5424 appendPQExpBufferChar(msg, '\n');
5425
5426 pg_log_error("%s", msg->data);
5427
5428 destroyPQExpBuffer(msg);
5429}

Callers 2

lookup_object_oidFunction · 0.85
get_create_object_cmdFunction · 0.85

Calls 6

createPQExpBufferFunction · 0.85
PQresultErrorFieldFunction · 0.85
printfPQExpBufferFunction · 0.85
appendPQExpBufferStrFunction · 0.85
appendPQExpBufferCharFunction · 0.85
destroyPQExpBufferFunction · 0.85

Tested by

no test coverage detected