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.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Puedes vivir sólo una vez, pero si lo haces bien, una vez es suficiente"


Reply via email to