diff --git a/sql_utils/repmgr_wrapper_funcs.c b/sql_utils/repmgr_wrapper_funcs.c index dc3c3448..51952f6f 100644 --- a/sql_utils/repmgr_wrapper_funcs.c +++ b/sql_utils/repmgr_wrapper_funcs.c @@ -20,10 +20,16 @@ PG_FUNCTION_INFO_V1(last_xlog_replay_timestamp); Datum last_xlog_replay_timestamp(PG_FUNCTION_ARGS) { +TimestampTz rTime; +bool fromSource; + if (!InRecovery) PG_RETURN_NULL(); else - PG_RETURN_TIMESTAMPTZ(GetLatestXLogTime()); + { + GetXLogReceiptTime(&rTime, &fromStream); + PG_RETURN_TIMESTAMPTZ(rTime); + } }