1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add a pg_lsn data type, to represent an LSN.

Robert Haas and Michael Paquier
This commit is contained in:
Robert Haas
2014-02-19 08:35:23 -05:00
parent a222f7fda6
commit 7d03a83f4d
14 changed files with 391 additions and 3 deletions

View File

@ -180,6 +180,12 @@
<entry>geometric path on a plane</entry>
</row>
<row>
<entry><type>pg_lsn</type></entry>
<entry></entry>
<entry><productname>PostgreSQL</productname> Log Sequence Number</entry>
</row>
<row>
<entry><type>point</type></entry>
<entry></entry>
@ -4504,6 +4510,32 @@ SELECT * FROM pg_attribute
</para>
</sect1>
<sect1 id="datatype-pg-lsn">
<title><acronym>pg_lsn Type</acronym></title>
<indexterm zone="datatype-pg-lsn">
<primary>pg_lsn</primary>
</indexterm>
<para>
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 XLOG. This type is a
representation of XLogRecPtr and an internal system type of
<productname>PostgreSQL</productname>.
</para>
<para>
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</>. The <type>pg_lsn</type> type supports the
standard comparison operators, like <literal>=</literal> and
<literal>&gt;</literal>. Two LSNs can be subtracted using the
<literal>-</literal> operator; the result is the number of bytes separating
those write-ahead log positions.
</para>
</sect1>
<sect1 id="datatype-pseudo">
<title>Pseudo-Types</title>