aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2012-03-04 12:15:24 +0100
committerMagnus Hagander <magnus@hagander.net>2012-03-04 12:22:38 +0100
commitbc5ac3686580079bd4ea26bf027178786d77a9ee (patch)
treee8ba991d3227149fb636a1f0f00d6c8597035ac9 /doc/src
parent0e5e167aaea4ceb355a6e20eec96c4f7d05527ab (diff)
downloadpostgresql-bc5ac3686580079bd4ea26bf027178786d77a9ee.tar.gz
postgresql-bc5ac3686580079bd4ea26bf027178786d77a9ee.zip
Add function pg_xlog_location_diff to help comparisons
Comparing two xlog locations are useful for example when calculating replication lag. Euler Taveira de Oliveira, reviewed by Fujii Masao, and some cleanups from me
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml20
1 files changed, 19 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 5c1cff3618d..34fea16eeee 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -14475,11 +14475,15 @@ SELECT set_config('log_statement_stats', 'off', false);
<indexterm>
<primary>pg_xlogfile_name_offset</primary>
</indexterm>
+ <indexterm>
+ <primary>pg_xlog_location_diff</primary>
+ </indexterm>
<para>
The functions shown in <xref
linkend="functions-admin-backup-table"> assist in making on-line backups.
- These functions cannot be executed during recovery.
+ These functions cannot be executed during recovery (except
+ <function>pg_xlog_location_diff</function>).
</para>
<table id="functions-admin-backup-table">
@@ -14547,6 +14551,13 @@ SELECT set_config('log_statement_stats', 'off', false);
<entry><type>text</>, <type>integer</></entry>
<entry>Convert transaction log location string to file name and decimal byte offset within file</entry>
</row>
+ <row>
+ <entry>
+ <literal><function>pg_xlog_location_diff(<parameter>location</> <type>text</>, <parameter>location</> <type>text</>)</function></literal>
+ </entry>
+ <entry><type>numeric</></entry>
+ <entry>Calculate the difference between two transaction log locations</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -14640,6 +14651,13 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
</para>
<para>
+ <function>pg_xlog_location_diff</> calculates the difference in bytes
+ between two transaction log locations. It can be used with
+ <structname>pg_stat_replication</structname> or some functions shown in
+ <xref linkend="functions-admin-backup-table"> to get the replication lag.
+ </para>
+
+ <para>
For details about proper usage of these functions, see
<xref linkend="continuous-archiving">.
</para>