diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 8594d424d60..a48126f8fa3 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -3320,7 +3320,7 @@ readCommandResponse(CState *st, MetaCommand meta, char *varprefix) pg_log_debug("client %d pipeline ending", st->id); if (PQexitPipelineMode(st->con) != 1) pg_log_error("client %d failed to exit pipeline mode: %s", st->id, - PQerrorMessage(st->con)); + PQresultErrorMessage(res)); break; case PGRES_NONFATAL_ERROR: @@ -3330,7 +3330,7 @@ readCommandResponse(CState *st, MetaCommand meta, char *varprefix) if (canRetryError(st->estatus)) { if (verbose_errors) - commandError(st, PQerrorMessage(st->con)); + commandError(st, PQresultErrorMessage(res)); goto error; } /* fall through */ @@ -3339,7 +3339,7 @@ readCommandResponse(CState *st, MetaCommand meta, char *varprefix) /* anything else is unexpected */ pg_log_error("client %d script %d aborted in command %d query %d: %s", st->id, st->use_file, st->command, qrynum, - PQerrorMessage(st->con)); + PQresultErrorMessage(res)); goto error; }