data type name, and
constraint name are supplied only for a limited number of error types;
see <xref linkend="errcodes-appendix"/>. Frontends should not assume that
the presence of any of these fields guarantees the presence of another
field. Core error sources observe the interrelationships noted above, but
user-defined functions may use these fields in other ways. In the same
vein, clients should not assume that these fields denote contemporary
objects in the current database.
</para>
</note>
<para>
The client is responsible for formatting displayed information to meet its
needs; in particular it should break long lines as needed. Newline characters
appearing in the error message fields should be treated as paragraph breaks,
not line breaks.
</para>
</sect1>
<sect1 id="protocol-logicalrep-message-formats">
<title>Logical Replication Message Formats</title>
<para>
This section describes the detailed format of each logical replication
message. These messages are either returned by the replication slot SQL
interface or are sent by a walsender. In the case of a walsender, they are
encapsulated inside replication protocol WAL messages as described in
<xref linkend="protocol-replication"/>, and generally obey the same message
flow as physical replication.
</para>
<variablelist>
<varlistentry id="protocol-logicalrep-message-formats-Begin">
<term>Begin</term>
<listitem>
<variablelist>
<varlistentry>
<term>Byte1('B')</term>
<listitem>
<para>
Identifies the message as a begin message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Int64 (XLogRecPtr)</term>
<listitem>
<para>
The final LSN of the transaction.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Int64 (TimestampTz)</term>
<listitem>
<para>
Commit timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Int32 (TransactionId)</term>
<listitem>
<para>
Xid of the transaction.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry id="protocol-logicalrep-message-formats-Message">
<term>Message</term>
<listitem>
<variablelist>
<varlistentry>
<term>Byte1('M')</term>
<listitem>
<para>
Identifies the message as a logical decoding message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Int32 (TransactionId)</term>
<listitem>
<para>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Int8</term>
<listitem>
<para>
Flags; Either 0 for no flags or 1 if the logical decoding
message is transactional.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Int64 (XLogRecPtr)</term>
<listitem>
<para>
The LSN of the logical decoding message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>String</term>
<listitem>
<para>
The prefix of the logical decoding message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Int32</term>
<listitem>
<para>
Length of the content.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Byte<replaceable>n</replaceable></term>
<listitem>
<para>
The content of the logical decoding message.