Re: AW: AW: Replication Testing- How to introduce a Lag

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: AW: Replication Testing- How to introduce a Lag
Date: 2026-03-21 08:43:10
Message-ID: fc42f77c80fdb3c0267148b807edfacc49b0b0ca.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sat, 2026-03-21 at 07:49 +0000, Subramanian,Ramachandran wrote:
> > Look at "pg_stat_replication" on the primary server.
>
> If I just look at the write_lag columns, it would give me a good idea of the situation --  Is my understanding correct ?

Yes, but if no WAL gets generated and replicated for a while, the columns will
become NULL, because then delay measured in time makes no sense.

Therefore, I prefer to use "replay_lsn" and friends and measure the lag in bytes.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ibrahim Shaame 2026-03-21 14:31:42 Merging two queries and I get syntax errors
Previous Message Subramanian,Ramachandran 2026-03-21 07:49:32 AW: AW: Replication Testing- How to introduce a Lag