File tree 5 files changed +41
-1
lines changed
5 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -13551,6 +13551,9 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
13551
13551
<indexterm>
13552
13552
<primary>pg_last_xlog_replay_location</primary>
13553
13553
</indexterm>
13554
+ <indexterm>
13555
+ <primary>pg_last_xact_replay_timestamp</primary>
13556
+ </indexterm>
13554
13557
13555
13558
<para>
13556
13559
The functions shown in <xref
@@ -13605,6 +13608,22 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
13605
13608
the function returns NULL.
13606
13609
</entry>
13607
13610
</row>
13611
+ <row>
13612
+ <entry>
13613
+ <literal><function>pg_last_xact_replay_timestamp()</function></literal>
13614
+ </entry>
13615
+ <entry><type>timestamp with time zone</type></entry>
13616
+ <entry>Get timestamp of last transaction replayed during recovery.
13617
+ This is the time at which the commit or abort WAL record for that
13618
+ transaction was generated.
13619
+ If no transactions have been replayed during recovery, this function
13620
+ returns NULL. Otherwise, if recovery is still in progress this will
13621
+ increase monotonically. If recovery has completed then this value will
13622
+ remain static at the value of the last transaction applied during that
13623
+ recovery. When the server has been started normally without recovery
13624
+ the function returns NULL.
13625
+ </entry>
13626
+ </row>
13608
13627
</tbody>
13609
13628
</tgroup>
13610
13629
</table>
Original file line number Diff line number Diff line change @@ -5604,6 +5604,24 @@ GetLatestXTime(void)
5604
5604
return xtime ;
5605
5605
}
5606
5606
5607
+ /*
5608
+ * Returns timestamp of latest processed commit/abort record.
5609
+ *
5610
+ * When the server has been started normally without recovery the function
5611
+ * returns NULL.
5612
+ */
5613
+ Datum
5614
+ pg_last_xact_replay_timestamp (PG_FUNCTION_ARGS )
5615
+ {
5616
+ TimestampTz xtime ;
5617
+
5618
+ xtime = GetLatestXTime ();
5619
+ if (xtime == 0 )
5620
+ PG_RETURN_NULL ();
5621
+
5622
+ PG_RETURN_TIMESTAMPTZ (xtime );
5623
+ }
5624
+
5607
5625
/*
5608
5626
* Returns bool with current recovery mode, a global state.
5609
5627
*/
Original file line number Diff line number Diff line change @@ -271,6 +271,7 @@ extern Datum pg_current_xlog_location(PG_FUNCTION_ARGS);
271
271
extern Datum pg_current_xlog_insert_location (PG_FUNCTION_ARGS );
272
272
extern Datum pg_last_xlog_receive_location (PG_FUNCTION_ARGS );
273
273
extern Datum pg_last_xlog_replay_location (PG_FUNCTION_ARGS );
274
+ extern Datum pg_last_xact_replay_timestamp (PG_FUNCTION_ARGS );
274
275
extern Datum pg_xlogfile_name_offset (PG_FUNCTION_ARGS );
275
276
extern Datum pg_xlogfile_name (PG_FUNCTION_ARGS );
276
277
extern Datum pg_is_in_recovery (PG_FUNCTION_ARGS );
Original file line number Diff line number Diff line change 53
53
*/
54
54
55
55
/* yyyymmddN */
56
- #define CATALOG_VERSION_NO 201010301
56
+ #define CATALOG_VERSION_NO 201011091
57
57
58
58
#endif
Original file line number Diff line number Diff line change @@ -3383,6 +3383,8 @@ DATA(insert OID = 3820 ( pg_last_xlog_receive_location PGNSP PGUID 12 1 0 0 f f
3383
3383
DESCR ("current xlog flush location" );
3384
3384
DATA (insert OID = 3821 ( pg_last_xlog_replay_location PGNSP PGUID 12 1 0 0 f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_last_xlog_replay_location _null_ _null_ _null_ ));
3385
3385
DESCR ("last xlog replay location" );
3386
+ DATA (insert OID = 3830 ( pg_last_xact_replay_timestamp PGNSP PGUID 12 1 0 0 f f f t f v 0 0 1184 "" _null_ _null_ _null_ _null_ pg_last_xact_replay_timestamp _null_ _null_ _null_ ));
3387
+ DESCR ("timestamp of last replay xact" );
3386
3388
3387
3389
DATA (insert OID = 2621 ( pg_reload_conf PGNSP PGUID 12 1 0 0 f f f t f v 0 0 16 "" _null_ _null_ _null_ _null_ pg_reload_conf _null_ _null_ _null_ ));
3388
3390
DESCR ("reload configuration files" );
You can’t perform that action at this time.
0 commit comments