summaryrefslogtreecommitdiff
path: root/src/bin/pgbench/pgbench.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pgbench/pgbench.c')
-rw-r--r--src/bin/pgbench/pgbench.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 36c6469149e..1515ed405ba 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -3359,6 +3359,20 @@ readCommandResponse(CState *st, MetaCommand meta, char *varprefix)
PQresultErrorMessage(res));
break;
+ case PGRES_COPY_IN:
+ case PGRES_COPY_OUT:
+ case PGRES_COPY_BOTH:
+ pg_log_error("COPY is not supported in pgbench, aborting");
+
+ /*
+ * We need to exit the copy state. Otherwise, PQgetResult()
+ * will always return an empty PGresult as an effect of
+ * getCopyResult(), leading to an infinite loop in the error
+ * cleanup done below.
+ */
+ PQendcopy(st->con);
+ goto error;
+
case PGRES_NONFATAL_ERROR:
case PGRES_FATAL_ERROR:
st->estatus = getSQLErrorStatus(PQresultErrorField(res,