mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Add monitoring function pg_last_xact_replay_timestamp.
Fujii Masao, with a little wordsmithing by me.
This commit is contained in:
@ -5604,6 +5604,24 @@ GetLatestXTime(void)
|
||||
return xtime;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns timestamp of latest processed commit/abort record.
|
||||
*
|
||||
* When the server has been started normally without recovery the function
|
||||
* returns NULL.
|
||||
*/
|
||||
Datum
|
||||
pg_last_xact_replay_timestamp(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TimestampTz xtime;
|
||||
|
||||
xtime = GetLatestXTime();
|
||||
if (xtime == 0)
|
||||
PG_RETURN_NULL();
|
||||
|
||||
PG_RETURN_TIMESTAMPTZ(xtime);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns bool with current recovery mode, a global state.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user