diff --git a/contrib/vacuumlo/vacuumlo.c b/contrib/vacuumlo/vacuumlo.c index 8f150273854..fd8dce5666b 100644 --- a/contrib/vacuumlo/vacuumlo.c +++ b/contrib/vacuumlo/vacuumlo.c @@ -311,7 +311,7 @@ vacuumlo(const char *database, const struct _param * param) deleted = 0; - while (1) + do { res = PQexec(conn, buf); if (PQresultStatus(res) != PGRES_TUPLES_OK) @@ -349,8 +349,7 @@ vacuumlo(const char *database, const struct _param * param) if (PQtransactionStatus(conn) == PQTRANS_INERROR) { success = false; - PQclear(res); - break; + break; /* out of inner for-loop */ } } else @@ -388,7 +387,7 @@ vacuumlo(const char *database, const struct _param * param) } PQclear(res); - } + } while (success); /* * That's all folks!