postgresql

LSN external representation


According to postgres documentation, LSN is a 64-bit integer, representing a byte position in the write-ahead log stream. It is printed as two hexadecimal numbers of up to 8 digits each, separated by a slash; for example, 16/B374D848. Does anyone know what is the meaning of these 2 hexadecimal numbers?


Solution

  • Left pad the part right of the slash with zeros, then remove the slash, and you have the offset in bytes described by the documentation.