Re: AW: how long should Archive logs be retained - Mailing list pgsql-novice

From Laurenz Albe
Subject Re: AW: how long should Archive logs be retained
Date
Msg-id 882aecb90795236e37a354d986d4ccebf8ad9c4c.camel@cybertec.at
Whole thread Raw
In response to AW: how long should Archive logs be retained  ("Subramanian,Ramachandran" <ramachandran.subramanian@alte-leipziger.de>)
List pgsql-novice
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



pgsql-novice by date:

Previous
From: "Subramanian,Ramachandran"
Date:
Subject: AW: how long should Archive logs be retained
Next
From: Laurenz Albe
Date:
Subject: Re: AW: how long should Archive logs be retained