*** pgbench.c.orig Mon Jan 22 11:17:30 2007 --- pgbench.c Tue Mar 13 14:47:05 2007 *************** init(void) *** 826,831 **** --- 826,832 ---- * avoid generating too much WAL logs */ fprintf(stderr, "%d tuples done.\n", j); + fflush(stderr); if (PQputline(con, "\\.\n")) { fprintf(stderr, "very last PQputline failed\n"); *************** init(void) *** 854,859 **** --- 855,861 ---- } } fprintf(stderr, "set primary key...\n"); + fflush(stderr); for (i = 0; i < (sizeof(DDLAFTERs) / sizeof(char *)); i++) { res = PQexec(con, DDLAFTERs[i]); *************** init(void) *** 867,872 **** --- 869,875 ---- /* vacuum */ fprintf(stderr, "vacuum..."); + fflush(stderr); res = PQexec(con, "vacuum analyze"); if (PQresultStatus(res) != PGRES_COMMAND_OK) { *************** init(void) *** 875,880 **** --- 878,884 ---- } PQclear(res); fprintf(stderr, "done.\n"); + fflush(stderr); PQfinish(con); } *************** main(int argc, char **argv) *** 1451,1456 **** --- 1455,1461 ---- if (!is_no_vacuum) { fprintf(stderr, "starting vacuum..."); + fflush(stderr); res = PQexec(con, "vacuum branches"); if (PQresultStatus(res) != PGRES_COMMAND_OK) { *************** main(int argc, char **argv) *** 1483,1492 **** --- 1488,1499 ---- PQclear(res); fprintf(stderr, "end.\n"); + fflush(stderr); if (is_full_vacuum) { fprintf(stderr, "starting full vacuum..."); + fflush(stderr); res = PQexec(con, "vacuum analyze accounts"); if (PQresultStatus(res) != PGRES_COMMAND_OK) { *************** main(int argc, char **argv) *** 1495,1500 **** --- 1502,1508 ---- } PQclear(res); fprintf(stderr, "end.\n"); + fflush(stderr); } } PQfinish(con); *************** main(int argc, char **argv) *** 1634,1639 **** --- 1642,1648 ---- if (state[i].ecnt > prev_ecnt && commands[state[i].state]->type == META_COMMAND) { fprintf(stderr, "Client %d aborted in state %d. Execution meta-command failed.\n", i, state[i].state); + fflush(stderr); remains--; /* I've aborted */ PQfinish(state[i].con); state[i].con = NULL;