Subject: Re: Lifetime of commit timestamps

From: "Euler Taveira" <[email-masked]>
Date: Fri, 17 Nov 2023 15:39:14 -0300

On Mon, Nov 13, 2023, at 9:47 PM, Bruce Momjian wrote:
> Is this documentation change still relevant?

I think so. AFAICS nothing changed. Unless you read the source code, it is not
clear that VACUUM removes the information for frozen tuples. They are decoupled
(but executed in the same routine for convenience), hence, someone can ask why
the pg_xact_commit_timestamp() returns NULL for a transaction that was executed
*after* you enable track_commit_timestamp. The answer is the design used a
existing mechanism to clean up data in order to avoid creating a new one.

--
Euler Taveira
EDB   https://www.enterprisedb.com/

---

From: Bruce Momjian <[email-masked]>
Date: Fri, 17 Nov 2023 16:01:27 -0500

> existing mechanism to clean up data in order to avoid creating a new one.

Okay, I have developed the attached patch based on Horiguchi-san's
version.

-- 
  Bruce Momjian  <[email-masked]>        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..b311a11b33 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25978,7 +25978,8 @@ SELECT collation for ('foo' COLLATE "de_DE");
     They only provide useful data when the
     <xref linkend="guc-track-commit-timestamp"/> configuration option is
     enabled, and only for transactions that were committed after it was
-    enabled.
+    enabled.  The commit timestamps of frozen tuples are removed during
+    vacuum.
    </para>
 
    <table id="functions-commit-timestamp">