diff options
author | Tom Lane | 2017-06-30 16:22:33 +0000 |
---|---|---|
committer | Tom Lane | 2017-06-30 16:22:33 +0000 |
commit | 609fa63db6d1e1f2c27a6dd31e9ac8d3b7bcae03 (patch) | |
tree | c10346a18a82da886b2df9eee1f4121ad79dbcfc | |
parent | fca85f8ef157d4d58dea1fdc8e1f1f957b74ee78 (diff) |
Check for error during PQendcopy.
Oversight in commit 78c8c8143; noted while nosing around the
walreceiver startup/shutdown code.
-rw-r--r-- | src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c index 2f0ed035fc..93dd7b5c17 100644 --- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c +++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c @@ -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); |