↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / System Administration Functions

pg_wal_lsn_diff

Read the PG 18 manual

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

Reading PG 18current·documented in 11 of 27 versions, 10 to 20

Signatures & examples

pg_wal_lsn_diff ( lsn1 pg_lsn, lsn2 pg_lsn ) → numeric
Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.97 to get the replication lag.
Version history 9
  1. 19 → 20 changed
  2. 18 → 19 changed
  3. 17 → 18 changed
  4. 16 → 17 changed
  5. 15 → 16 changed
  6. 14 → 15 changed
  7. 13 → 14 changed
  8. 12 → 13 changed
  9. 9.6 → 10 added

Definition snapshot: b7bd9cda · English manual source