psql: Avoid some spurious output if the server croaks.

Fixes a regression in commit 08146775ac.

Noah Misch
This commit is contained in:
Robert Haas 2012-03-07 16:56:42 -05:00
parent 1673122127
commit cf7026b64b

View File

@ -740,7 +740,7 @@ ProcessResult(PGresult **results)
} while (next_result);
/* may need this to recover from conn loss during COPY */
if (!CheckConnection())
if (!first_cycle && !CheckConnection())
return false;
return success;
@ -1015,8 +1015,10 @@ SendQuery(const char *query)
case PQTRANS_UNKNOWN:
default:
OK = false;
psql_error("unexpected transaction status (%d)\n",
transaction_status);
/* PQTRANS_UNKNOWN is expected given a broken connection. */
if (transaction_status != PQTRANS_UNKNOWN || ConnectionUp())
psql_error("unexpected transaction status (%d)\n",
transaction_status);
break;
}