Hi, On Wed, 25 Nov 2026 at 19:18, Álvaro Herrera <[email protected]> wrote: > > Hello > > On 2026-Nov-25, Ayush Tiwari wrote: > > > While re-testing Jeff's patch [1], I found a similar issue with > > pg_commit_ts. After a crash, the row I had inserted was gone and > > pg_xact_status() said aborted, which is fine for an async commit, but > > pg_xact_commit_timestamp() still returned its commit timestamp > > instead of NULL. > > Hmm, I vaguely recall that the reason for this is that it's not supposed > to matter. pg_clog is the authoritative source to indicate whether a > transaction committed; if you inquire for the commit timestamp of a > transaction that didn't commit, it's your fault. When the transaction > commits again (I mean, the next time a transaction gets the same Xid > value), the commit_ts record would be updated to the new value, so > there's no harm. > > I'm not opposed to consider this change in master, but unless there's a > reason to think that this is a problem in practice, I wouldn't bother > backpatching.
Yeah, that makes sense. I'd expected NULL for an aborted xid, but I don't have a case where this causes trouble in practice. If the change seems worth doing, I'm happy to keep it to master. Regards, Ayush
