pg_lsn型 #
    The <type>pg_lsn</type> data type can be used to store LSN (Log Sequence
    Number) data which is a pointer to a location in the WAL. This type is a
    representation of <type>XLogRecPtr</type> and an internal system type of
    <productname>PostgreSQL</productname>.
pg_lsn型はWALの位置を示すLSN(Log Sequence Number)データを格納するために使用します。
この型はXLogRecPtrを示すPostgreSQLの内部的なシステムの型です。
   
    Internally, an 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,
    <literal>16/B374D848</literal>.  The <type>pg_lsn</type> type supports the
    standard comparison operators, like <literal>=</literal> and
    <literal>></literal>.  Two LSNs can be subtracted using the
    <literal>-</literal> operator; the result is the number of bytes separating
    those write-ahead log locations.  Also the number of bytes can be
    added into and subtracted from LSN using the
    <literal>+(pg_lsn,numeric)</literal> and
    <literal>-(pg_lsn,numeric)</literal> operators, respectively. Note that
    the calculated LSN should be in the range of <type>pg_lsn</type> type,
    i.e., between <literal>0/0</literal> and
    <literal>FFFFFFFF/FFFFFFFF</literal>.
内部的にはLSNは64bit整数型で、先行書き込みログ(WAL)ストリームのバイト位置を表現します。
LSNは例えば、16/B374D848のように2つのスラッシュで分けられた8桁の16進数で表示されます。
pg_lsnは例えば、=や>などの標準の比較演算子をサポートしています。
2つのLSNは-演算子を使い引き算することも可能で、結果はこれらの2つの先行書き込みログ(WAL)の位置のbytes差分です。
また、バイト数はそれぞれ+(pg_lsn,numeric)や-(pg_lsn,numeric)演算子を使って加算、減算ができます。
計算されたLSNはpg_lsn型の範囲、つまり、0/0とFFFFFFFF/FFFFFFFFの間にあるべきであることに注意してください。