Re: pg_wal_lsn_diff - Mailing list pgsql-docs

From Tom Lane
Subject Re: pg_wal_lsn_diff
Date
Msg-id 190699.1612630676@sss.pgh.pa.us
Whole thread Raw
In response to pg_wal_lsn_diff  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Responses Re: pg_wal_lsn_diff
List pgsql-docs
Tatsuo Ishii <ishii@sraoss.co.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



pgsql-docs by date:

Previous
From: Tatsuo Ishii
Date:
Subject: pg_wal_lsn_diff
Next
From: Tom Lane
Date:
Subject: Re: The synopsis of "ALTER DEFAULT PRIVILEGES" statement is too difficult to understand