Commit 609fa63d authored by Tom Lane's avatar Tom Lane

Check for error during PQendcopy.

Oversight in commit 78c8c814; noted while nosing around the
walreceiver startup/shutdown code.
parent fca85f8e
......@@ -459,7 +459,10 @@ libpqrcv_endstreaming(WalReceiverConn *conn, TimeLineID *next_tli)
PQclear(res);
/* End the copy */
PQendcopy(conn->streamConn);
if (PQendcopy(conn->streamConn))
ereport(ERROR,
(errmsg("error while shutting down streaming COPY: %s",
pchomp(PQerrorMessage(conn->streamConn)))));
/* CommandComplete should follow */
res = PQgetResult(conn->streamConn);
......
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