On Mon, Nov 13, 2023 at 05:32:24PM -0800, Andres Freund wrote:
> Hi,
>
> On 2023-11-13 17:00:43 -0800, Peter Geoghegan wrote:
> > On Mon, Nov 13, 2023 at 4:43 PM Bruce Momjian <[email protected]> wrote:
> > > I looked into this and all the 4-byte xid functions are marked as
> > > deprecated for the 8-byte variants. I don't think documenting 4-byte
> > > mxid_age() and age(xid) makes sense anymore, and I don't see their value
> > > enough to create 8-byte versions, so I just added C comments that they
> > > were undocumented, in the attached patch.
> >
> > I'm sympathetic to the goal of making 4 byte XIDs an on-disk
> > implementation detail that is all but completely hidden from users.
> > However, there are practical problems with taking that to its logical
> > extreme. At least right now.
> >
> > These functions are in fact documented -- albeit only partially. There
> > are references to both in "Routine Vacuuming". Moreover, those
> > references are rather useful; they're the basis of many
> > monitoring/alerting queries. If anything, I'd recommend adding more
> > documentation for these two functions.
>
> +1
Seems people still like these functions, so here is a patch to properly
document them. :-)
--
Bruce Momjian <[email protected]> https://momjian.us
EDB https://enterprisedb.com
Only you can decide what is important to you.
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 93f068edcf..71713f471d 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25860,6 +25860,34 @@ SELECT collation for ('foo' COLLATE "de_DE");
</thead>
<tbody>
+ <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>