Glossary: PostgreSQL Beyond the Basics
LSN
Also written: log sequence number, pg_current_wal_lsn(), pg_wal_lsn_diff()
Log sequence number: a position in the WAL that only ever grows. Subtracting two LSNs shows how many bytes of WAL a replica hasn't replayed.