summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2017-06-30 16:22:33 +0000
committerTom Lane2017-06-30 16:22:33 +0000
commit609fa63db6d1e1f2c27a6dd31e9ac8d3b7bcae03 (patch)
treec10346a18a82da886b2df9eee1f4121ad79dbcfc
parentfca85f8ef157d4d58dea1fdc8e1f1f957b74ee78 (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.c5
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);