summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Bossart2025-07-01 15:36:27 +0000
committerNathan Bossart2025-07-01 15:36:27 +0000
commit326f2aaee6472c43b8eb3f5528c825ecfdf540a1 (patch)
tree65a699c1c392b7fec510c0d9f9ed8da9b46f323f
parent25cab4473525cd3705fc8ee524b85721db967b65 (diff)
Document age(xid) and mxid_age(xid).
These functions have been around for some time, but commits 48b5aa3143 and 15afb7d61c were only back-patched to v16. Let's back-patch them to all supported versions now. Reported-by: David Rowley <[email protected]> (commit 48b5aa3143) Author: Bruce Momjian <[email protected]> (commit 48b5aa3143) Co-authored-by: Bertrand Drouvot <[email protected]> (commit 15afb7d61c) Reviewed-by: Michael Paquier <[email protected]> (commit 15afb7d61c) Reviewed-by: Robert Haas <[email protected]> Reviewed-by: Álvaro Herrera <[email protected]> Discussion: https://postgr.es/m/aGMCxHxLfeMdQk8m%40nathan Backpatch-through: 13-15
-rw-r--r--doc/src/sgml/func.sgml31
1 files changed, 30 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 0bb80d784da..c36ee647355 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -24117,6 +24117,34 @@ SELECT collation for ('foo' COLLATE "de_DE");
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>age</primary>
+ </indexterm>
+ <function>age</function> ( <type>xid</type> )
+ <returnvalue>integer</returnvalue>
+ </para>
+ <para>
+ Returns the number of transactions between the supplied
+ transaction id and the current transaction counter.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
+ <primary>mxid_age</primary>
+ </indexterm>
+ <function>mxid_age</function> ( <type>xid</type> )
+ <returnvalue>integer</returnvalue>
+ </para>
+ <para>
+ Returns the number of multixacts IDs between the supplied
+ multixact ID and the current multixacts counter.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>pg_current_xact_id</primary>
</indexterm>
<function>pg_current_xact_id</function> ()
@@ -24249,7 +24277,8 @@ SELECT collation for ('foo' COLLATE "de_DE");
<para>
The internal transaction ID type <type>xid</type> is 32 bits wide and
wraps around every 4 billion transactions. However,
- the functions shown in <xref linkend="functions-pg-snapshot"/> use a
+ the functions shown in <xref linkend="functions-pg-snapshot"/>, except
+ <function>age</function> and <function>mxid_age</function>, use a
64-bit type <type>xid8</type> that does not wrap around during the life
of an installation, and can be converted to <type>xid</type> by casting if
required. The data type <type>pg_snapshot</type> stores information about