Re: AW: how long should Archive logs be retained

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "Subramanian,Ramachandran" <ramachandran(dot)subramanian(at)alte-leipziger(dot)de>, "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Re: AW: how long should Archive logs be retained
Date: 2025-11-28 07:10:49
Message-ID: 882aecb90795236e37a354d986d4ccebf8ad9c4c.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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 data buffers 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Laurenz Albe 2025-11-28 07:15:31 Re: AW: how long should Archive logs be retained
Previous Message Subramanian,Ramachandran 2025-11-28 05:28:59 AW: how long should Archive logs be retained