src/bin/psql/command.c
static void
minimal_error_message(PGresult *res)
{
	PQExpBuffer msg;
	const char *fld;

	msg = createPQExpBuffer();

	fld = PQresultErrorField(res, PG_DIAG_SEVERITY);
	if (fld)
		printfPQExpBuffer(msg, "%s:  ", fld);
	else
		printfPQExpBuffer(msg, "ERROR:  ");
	fld = PQresultErrorField(res, PG_DIAG_MESSAGE_PRIMARY);
	if (fld)
		appendPQExpBufferStr(msg, fld);
	else
		appendPQExpBufferStr(msg, "(not available)");
	appendPQExpBufferChar(msg, '\n');

	pg_log_error("%s", msg->data);

	destroyPQExpBuffer(msg);
}
/*
 * Report just the primary error; this is to avoid cluttering the output
 * with, for instance, a redisplay of the internally generated query
 */
Report just the primary error; this is to avoid cluttering the output
with, for instance, a redisplay of the internally generated query
Report just the primary error ; this is to avoid cluttering the output with for instance a redisplay of the internally generated query
static void
minimal_error_message(PGresult *res)
{
	PQExpBuffer msg;
	const char *fld;
	msg = createPQExpBuffer();
	fld = PQresultErrorField(res, PG_DIAG_SEVERITY);
	if (fld)
		printfPQExpBuffer(msg, "%s:  ", fld);
	else
		printfPQExpBuffer(msg, "ERROR:  ");
	fld = PQresultErrorField(res, PG_DIAG_MESSAGE_PRIMARY);
	if (fld)
		appendPQExpBufferStr(msg, fld);
	else
		appendPQExpBufferStr(msg, "(not available)");
	appendPQExpBufferChar(msg, '\n');
	pg_log_error("%s", msg->data);
	destroyPQExpBuffer(msg);
}
static void minimal_error_message ( PGresult * res ) { PQExpBuffer msg ; const char * fld ; msg = createPQExpBuffer ( ) ; fld = PQresultErrorField ( res , PG_DIAG_SEVERITY ) ; if ( fld ) printfPQExpBuffer ( msg , " " , fld ) ; else printfPQExpBuffer ( msg , " " ) ; fld = PQresultErrorField ( res , PG_DIAG_MESSAGE_PRIMARY ) ; if ( fld ) appendPQExpBufferStr ( msg , fld ) ; else appendPQExpBufferStr ( msg , " " ) ; appendPQExpBufferChar ( msg , ' \n ' ) ; pg_log_error ( " " , msg -> data ) ; destroyPQExpBuffer ( msg ) ; }
Report just the primary error; this is to avoid cluttering the output
 with, for instance, a redisplay of the internally generated query
Report just the primary error ; this is to avoid cluttering the output with for instance a redisplay of the internally generated query