Re: pg_wal_lsn_diff

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: pg_wal_lsn_diff
Date: 2021-02-06 16:57:56
Message-ID: 190699.1612630676@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> writes:
> According to the pg_wal_lsn_diff manual:
> pg_wal_lsn_diff ( lsn pg_lsn, lsn pg_lsn ) $B"*(B numeric

> Calculates the difference in bytes between two write-ahead log
> locations. This can be used with pg_stat_replication or some of
> the functions shown in Table 9.87 to get the replication lag.

> It's not clear whether its return value is (first arg - second arg) or
> (second arg - first arg). The order matters because the return value
> could have a sign (it actually does first arg - second arg). Attached
> is a patch to fix the description.

+1 for fixing that. Two notes though: first, your text doesn't agree
with the prototype ("ls1" should be "lsn1"), and second, I think it
would read better if you didn't split the phrase "difference in bytes".
That is,

- Calculates the difference in bytes between two write-ahead log
+ Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log

Also maybe you should use the <parameter>lsn1</parameter> markup
in the text.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2021-02-06 20:48:26 Re: The synopsis of "ALTER DEFAULT PRIVILEGES" statement is too difficult to understand
Previous Message Tatsuo Ishii 2021-02-06 06:11:25 pg_wal_lsn_diff