The LSN acts as the atomic physical clock across database engines:
- 1Whenever a buffer page is mutated in shared memory, it receives an updated
Page LSNheader marking the exact journal transaction. - 2Under the Write-Ahead Log (WAL) Flush Rule, a dirty memory buffer can never be written to persistent storage until its corresponding journal record has been flushed and fsynced to disk up to that specific LSN.
- 3In physical replication topologies, replication lag between primary and standby replicas is quantified with byte-level precision by calculating:
pg_wal_lsn_diff(write_lsn, replay_lsn).