- Protocol version. Currently only version 1 is
- supported.
-
+ Protocol version. Currently versions 1 and
+ 2 are supported. The version 2
+ is supported only for server version 14 and above, and it allows
+ streaming of large in-progress transactions.
+
The logical replication protocol sends individual transactions one by one.
This means that all messages between a pair of Begin and Commit messages
- belong to the same transaction.
+ belong to the same transaction. It also sends changes of large in-progress
+ transactions between a pair of Stream Start and Stream Stop messages. The
+ last stream of such a transaction contains Stream Commit or Stream Abort
+ message.
- Xid of the transaction. The XID is sent only when user has
- requested streaming of in-progress transactions.
+ Xid of the transaction (only present for streamed transactions).
+ This field is available since protocol version 2.
Int32
+ Xid of the transaction (only present for streamed transactions).
+ This field is available since protocol version 2.
+
+
+
+
+
+ Int32
+
+
ID of the relation.
Int32
+ Xid of the transaction (only present for streamed transactions).
+ This field is available since protocol version 2.
+
+
+
+
+
+ Int32
+
+
ID of the data type.
Int32
+ Xid of the transaction (only present for streamed transactions).
+ This field is available since protocol version 2.
+
+
+
+
+
+ Int32
+
+
ID of the relation corresponding to the ID in the relation
message.
Int32
+ Xid of the transaction (only present for streamed transactions).
+ This field is available since protocol version 2.
+
+
+
+
+
+ Int32
+
+
ID of the relation corresponding to the ID in the relation
message.
Int32
+ Xid of the transaction (only present for streamed transactions).
+ This field is available since protocol version 2.
+
+
+
+
+
+ Int32
+
+
ID of the relation corresponding to the ID in the relation
message.
Int32
+ Xid of the transaction (only present for streamed transactions).
+ This field is available since protocol version 2.
+
+
+
+
+
+ Int32
+
+
Number of relations
+The following messages (Stream Start, Stream End, Stream Commit, and
+Stream Abort) are available since protocol version 2.
+
+
+
+
+
+
+
+Stream Start
+
+
+
+
+
+
+ Byte1('S')
+
+
+ Identifies the message as a stream start message.
+
+
+
+
+
+ Int32
+
+
+ Xid of the transaction.
+
+
+
+
+
+ Int8
+
+
+ A value of 1 indicates this is the first stream segment for
+ this XID, 0 for any other stream segment.
+
+
+
+
+
+
+
+
+
+
+
+Stream Stop
+
+
+
+
+
+
+ Byte1('E')
+
+
+ Identifies the message as a stream stop message.
+
+
+
+
+
+
+
+
+
+
+
+Stream Commit
+
+
+
+
+
+
+ Byte1('c')
+
+
+ Identifies the message as a stream commit message.
+
+
+
+
+
+ Int32
+
+
+ Xid of the transaction.
+
+
+
+
+
+ Int8
+
+
+ Flags; currently unused (must be 0).
+
+
+
+
+
+ Int64
+
+
+ The LSN of the commit.
+
+
+
+
+
+ Int64
+
+
+ The end LSN of the transaction.
+
+
+
+
+
+ Int64
+
+
+ Commit timestamp of the transaction. The value is in number
+ of microseconds since PostgreSQL epoch (2000-01-01).
+
+
+
+
+
+
+
+
+
+
+
+Stream Abort
+
+
+
+
+
+
+ Byte1('A')
+
+
+ Identifies the message as a stream abort message.
+
+
+
+
+
+ Int32
+
+
+ Xid of the transaction.
+
+
+
+
+
+ Int32
+
+
+ Xid of the subtransaction (will be same as xid of the transaction for top-level
+ transactions).
+
+
+
+
+
+
+
+
+
+
+
+
The following message parts are shared by the above messages.