Commit cf7026b6 authored by Robert Haas's avatar Robert Haas

psql: Avoid some spurious output if the server croaks.

Fixes a regression in commit 08146775.

Noah Misch
parent 16731221
......@@ -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,6 +1015,8 @@ SendQuery(const char *query)
case PQTRANS_UNKNOWN:
default:
OK = false;
/* PQTRANS_UNKNOWN is expected given a broken connection. */
if (transaction_status != PQTRANS_UNKNOWN || ConnectionUp())
psql_error("unexpected transaction status (%d)\n",
transaction_status);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment