diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c
index cf2195bc93..7302f36488 100644
--- a/src/backend/replication/slotfuncs.c
+++ b/src/backend/replication/slotfuncs.c
@@ -480,8 +480,8 @@ pg_replication_slot_advance(PG_FUNCTION_ARGS)
 				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 				 errmsg("cannot move slot to %X/%X, minimum is %X/%X",
 						(uint32) (moveto >> 32), (uint32) moveto,
-						(uint32) (MyReplicationSlot->data.confirmed_flush >> 32),
-						(uint32) (MyReplicationSlot->data.confirmed_flush))));
+						(uint32) (startlsn >> 32),
+						(uint32) (startlsn))));
 	}
 
 	if (OidIsValid(MyReplicationSlot->data.database))
