On Fri, 2025-11-28 at 04:46 +0000, Subramanian,Ramachandran wrote:
> Question >>> Wow !! That is so new to me. So
> 1. if log wrap around happens and some Wal-Files containing uncomitted log records are being overwritten,
No, they are deleted (well, perhaps recycled, but that amounts to the same).
> 2. AND iin the mean time some data updates pertaining to these uncomitted transactions have been flushed from the
databuffers to disk
> 3. AND after the data buffers have been flushed the transaction fails ( and I assume releases all the locks )
>
> how does postgres know that a particular unlocked row it finds in the disk ( or even the bufferpool
> for that matter ) is not in a valid state even though it physically exists in the table?
> How can it decode this information?
From the commit log that stores the state of every transaction.
Each table row knows which transaction created it and which transaction removed it.
So if the creating transaction is not committed, or if the deleting transaction is committed,
you cannot see the data.
Yours,
Laurenz Albe