Database files

PostgreSQL WAL position difference

Subtract WAL LSNs exactly and show segment-relative positions.

Your inputs

Start with an example

Your inputs stay in your browser.

Your result

Example result

How it works

Interpret each LSN as two 32-bit hex halves. Subtract right − left with 64-bit integer precision, then divide by segment size.

0/10 minus 0/0 is 16 bytes because the low half is hexadecimal.

Limits

A byte-position difference, not elapsed replication lag or a health estimate. Segment size must match the cluster and be a power of two MiB. Timelines and WAL filenames are not inferred.