1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Add pg_stat_get_snapshot_timestamp() to show statistics snapshot timestamp.

Per discussion, this could be useful for purposes such as programmatically
detecting a nonresponding stats collector.  We already have the timestamp
anyway, it's just a matter of providing a SQL-accessible function to fetch
it.

Matt Kelly, reviewed by Jim Nasby
This commit is contained in:
Tom Lane
2015-02-19 21:36:50 -05:00
parent 634618ecd0
commit 2fb7a75f37
6 changed files with 33 additions and 3 deletions

View File

@ -1709,6 +1709,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</entry>
</row>
<row>
<entry><literal><function>pg_stat_get_snapshot_timestamp()</function></literal><indexterm><primary>pg_stat_get_snapshot_timestamp</primary></indexterm></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>
Returns the timestamp of the current statistics snapshot
</entry>
</row>
<row>
<entry><literal><function>pg_stat_clear_snapshot()</function></literal><indexterm><primary>pg_stat_clear_snapshot</primary></indexterm></entry>
<entry><type>void</type></entry>