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