From 9f61ea6c5c577fb08799e17499794ad9e84baef8 Mon Sep 17 00:00:00 2001 From: postgres Date: Fri, 30 Jul 2010 11:39:29 -0500 Subject: [PATCH] In 9.0beta3 the function GetLatestXLogTime() was removed and replaced by GetLatestXTime() but this function cannot be called from external programs. Instead now we are using GetXLogReceiptTime() which tells us what was the last time we got a WAL record by streaming or file. --- sql_utils/repmgr_wrapper_funcs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); + } }