diff options
Diffstat (limited to 'src/backend/replication/walreceiver.c')
-rw-r--r-- | src/backend/replication/walreceiver.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index acda5f68d9a..a27aee63def 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -195,6 +195,7 @@ WalReceiverMain(char *startup_data, size_t startup_data_len) char *err; char *sender_host = NULL; int sender_port = 0; + char *appname; Assert(startup_data_len == 0); @@ -298,13 +299,13 @@ WalReceiverMain(char *startup_data, size_t startup_data_len) sigprocmask(SIG_SETMASK, &UnBlockSig, NULL); /* Establish the connection to the primary for XLOG streaming */ - wrconn = walrcv_connect(conninfo, true, false, false, - cluster_name[0] ? cluster_name : "walreceiver", - &err); + appname = cluster_name[0] ? cluster_name : "walreceiver"; + wrconn = walrcv_connect(conninfo, true, false, false, appname, &err); if (!wrconn) ereport(ERROR, (errcode(ERRCODE_CONNECTION_FAILURE), - errmsg("could not connect to the primary server: %s", err))); + errmsg("streaming replication receiver \"%s\" could not connect to the primary server: %s", + appname, err))); /* * Save user-visible connection string. This clobbers the original |