From: Nathan Bossart Date: Tue, 1 Jul 2025 15:36:27 +0000 (-0500) Subject: Document age(xid) and mxid_age(xid). X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=326f2aaee6472c43b8eb3f5528c825ecfdf540a1;p=thirdparty%2Fpostgresql.git 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 (commit 48b5aa3143) Author: Bruce Momjian (commit 48b5aa3143) Co-authored-by: Bertrand Drouvot (commit 15afb7d61c) Reviewed-by: Michael Paquier (commit 15afb7d61c) Reviewed-by: Robert Haas Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/aGMCxHxLfeMdQk8m%40nathan Backpatch-through: 13-15 --- 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 @@ -24114,6 +24114,34 @@ SELECT collation for ('foo' COLLATE "de_DE"); + + + + age + + age ( xid ) + integer + + + Returns the number of transactions between the supplied + transaction id and the current transaction counter. + + + + + + + mxid_age + + mxid_age ( xid ) + integer + + + Returns the number of multixacts IDs between the supplied + multixact ID and the current multixacts counter. + + + @@ -24249,7 +24277,8 @@ SELECT collation for ('foo' COLLATE "de_DE"); The internal transaction ID type xid is 32 bits wide and wraps around every 4 billion transactions. However, - the functions shown in use a + the functions shown in , except + age and mxid_age, use a 64-bit type xid8 that does not wrap around during the life of an installation, and can be converted to xid by casting if required. The data type pg_snapshot stores information about