pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedback-patch documentation for age() and mxid_age()
4+ messages / 3 participants
[nested] [flat]
* back-patch documentation for age() and mxid_age()
@ 2025-06-30 21:33 Nathan Bossart <nathandbossart@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Nathan Bossart @ 2025-06-30 21:33 UTC (permalink / raw)
To: pgsql-hackers
These functions have been around for a while, but commits 48b5aa3 and
15afb7d were only back-patched to v16. Any objections if I apply them down
to v13 now?
--
nathan
From 5c2fafe16a95bea32fd0808d596afb18446f69a6 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <nathan@postgresql.org>
Date: Mon, 30 Jun 2025 16:21:34 -0500
Subject: [PATCH v1 1/1] Document age(xid) and mxid_age(xid).
---
doc/src/sgml/func.sgml | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 372cb036fde..f11c4f711d4 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -24638,6 +24638,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>
@@ -24773,7 +24801,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
--
2.39.5 (Apple Git-154)
Attachments:
[text/plain] v1-0001-Document-age-xid-and-mxid_age-xid.patch (2.3K, ../../aGMCxHxLfeMdQk8m@nathan/2-v1-0001-Document-age-xid-and-mxid_age-xid.patch)
download | inline diff:
From 5c2fafe16a95bea32fd0808d596afb18446f69a6 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <nathan@postgresql.org>
Date: Mon, 30 Jun 2025 16:21:34 -0500
Subject: [PATCH v1 1/1] Document age(xid) and mxid_age(xid).
---
doc/src/sgml/func.sgml | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 372cb036fde..f11c4f711d4 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -24638,6 +24638,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>
@@ -24773,7 +24801,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
--
2.39.5 (Apple Git-154)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: back-patch documentation for age() and mxid_age()
@ 2025-07-01 02:15 Robert Haas <robertmhaas@gmail.com>
parent: Nathan Bossart <nathandbossart@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Robert Haas @ 2025-07-01 02:15 UTC (permalink / raw)
To: Nathan Bossart <nathandbossart@gmail.com>; +Cc: pgsql-hackers
On Mon, Jun 30, 2025 at 5:34 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
> These functions have been around for a while, but commits 48b5aa3 and
> 15afb7d were only back-patched to v16. Any objections if I apply them down
> to v13 now?
Seems fine to me.
--
Robert Haas
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: back-patch documentation for age() and mxid_age()
@ 2025-07-01 10:54 Álvaro Herrera <alvherre@kurilemu.de>
parent: Nathan Bossart <nathandbossart@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: Álvaro Herrera @ 2025-07-01 10:54 UTC (permalink / raw)
To: Nathan Bossart <nathandbossart@gmail.com>; +Cc: pgsql-hackers
On 2025-Jun-30, Nathan Bossart wrote:
> These functions have been around for a while, but commits 48b5aa3 and
> 15afb7d were only back-patched to v16. Any objections if I apply them
> down to v13 now?
None here.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"I'm impressed how quickly you are fixing this obscure issue. I came from
MS SQL and it would be hard for me to put into words how much of a better job
you all are doing on [PostgreSQL]."
Steve Midgley, http://archives.postgresql.org/pgsql-sql/2008-08/msg00000.php
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: back-patch documentation for age() and mxid_age()
@ 2025-07-01 15:39 Nathan Bossart <nathandbossart@gmail.com>
parent: Álvaro Herrera <alvherre@kurilemu.de>
0 siblings, 0 replies; 4+ messages in thread
From: Nathan Bossart @ 2025-07-01 15:39 UTC (permalink / raw)
To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: pgsql-hackers
Committed.
--
nathan
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2025-07-01 15:39 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-06-30 21:33 back-patch documentation for age() and mxid_age() Nathan Bossart <nathandbossart@gmail.com>
2025-07-01 02:15 ` Robert Haas <robertmhaas@gmail.com>
2025-07-01 10:54 ` Álvaro Herrera <alvherre@kurilemu.de>
2025-07-01 15:39 ` Nathan Bossart <nathandbossart@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox