public inbox for pgsql-novice@postgresql.org  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Subramanian,Ramachandran <ramachandran.subramanian@alte-leipziger.de>
To: pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>
Subject: Re: AW: AW: Replication Testing- How to introduce a Lag
Date: Sat, 21 Mar 2026 09:43:10 +0100
Message-ID: <fc42f77c80fdb3c0267148b807edfacc49b0b0ca.camel@cybertec.at> (raw)
In-Reply-To: <fa47fe18078043adbdfe007b7270ffd0@alte-leipziger.de>
References: <aadb9058660d4e10b5cee44b82458802@alte-leipziger.de>
	<f3927bc3a9baf4400325b91652869907f0581c97.camel@cybertec.at>
	<e1e41761323040228570cf6a7e02518e@alte-leipziger.de>
	<8b38fa5141905f9ad6983b8d5ae944e812e3d28a.camel@cybertec.at>
	<fa47fe18078043adbdfe007b7270ffd0@alte-leipziger.de>

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





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-novice@postgresql.org
  Cc: laurenz.albe@cybertec.at, ramachandran.subramanian@alte-leipziger.de, pgsql-novice@lists.postgresql.org
  Subject: Re: AW: AW: Replication Testing- How to introduce a Lag
  In-Reply-To: <fc42f77c80fdb3c0267148b807edfacc49b0b0ca.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox