diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index dc84b7b9b7..feb8f601ce 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -4162,7 +4162,11 @@ initGenerateDataClientSide(PGconn *con) /* * accounts is big enough to be worth using COPY and tracking runtime */ - res = PQexec(con, "copy pgbench_accounts from stdin"); + resetPQExpBuffer(&sql); + appendPQExpBufferStr(&sql, "copy pgbench_accounts from stdin"); + if (partitions == 0) + appendPQExpBufferStr(&sql, " with (freeze)"); + res = PQexec(con, sql.data); if (PQresultStatus(res) != PGRES_COPY_IN) { pg_log_fatal("unexpected copy in result: %s", PQerrorMessage(con));