aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/walreceiver.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c
index 43db10851c3..b0de0ea253e 100644
--- a/src/backend/replication/walreceiver.c
+++ b/src/backend/replication/walreceiver.c
@@ -1199,9 +1199,19 @@ ProcessWalSndrMessage(XLogRecPtr walEnd, TimestampTz sendTime)
SpinLockRelease(&walrcv->mutex);
if (log_min_messages <= DEBUG2)
+ {
+ char *sendtime;
+ char *receipttime;
+
+ /* Copy because timestamptz_to_str returns a static buffer */
+ sendtime = pstrdup(timestamptz_to_str(sendTime));
+ receipttime = pstrdup(timestamptz_to_str(lastMsgReceiptTime));
elog(DEBUG2, "sendtime %s receipttime %s replication apply delay %d ms transfer latency %d ms",
- timestamptz_to_str(sendTime),
- timestamptz_to_str(lastMsgReceiptTime),
+ sendtime,
+ receipttime,
GetReplicationApplyDelay(),
GetReplicationTransferLatency());
+ pfree(sendtime);
+ pfree(receipttime);
+ }
}