1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>55.9. Logical Replication Message Formats</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="protocol-error-fields.html" title="55.8. Error and Notice Message Fields" /><link rel="next" href="protocol-changes.html" title="55.10. Summary of Changes since Protocol 2.0" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">55.9. Logical Replication Message Formats</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="protocol-error-fields.html" title="55.8. Error and Notice Message Fields">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="protocol.html" title="Chapter 55. Frontend/Backend Protocol">Up</a></td><th width="60%" align="center">Chapter 55. Frontend/Backend Protocol</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="protocol-changes.html" title="55.10. Summary of Changes since Protocol 2.0">Next</a></td></tr></table><hr /></div><div class="sect1" id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">55.9. Logical Replication Message Formats <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS" class="id_link">#</a></h2></div></div></div><p>
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
<a class="xref" href="protocol-replication.html" title="55.4. Streaming Replication Protocol">Section 55.4</a>, and generally obey the same message
flow as physical replication.
</p><div class="variablelist"><dl class="variablelist"><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-BEGIN"><span class="term">Begin</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-BEGIN" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('B')</span></dt><dd><p>
Identifies the message as a begin message.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The final LSN of the transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Commit timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-MESSAGE"><span class="term">Message</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-MESSAGE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('M')</span></dt><dd><p>
Identifies the message as a logical decoding message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</p></dd><dt><span class="term">Int8</span></dt><dd><p>
Flags; Either 0 for no flags or 1 if the logical decoding
message is transactional.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the logical decoding message.
</p></dd><dt><span class="term">String</span></dt><dd><p>
The prefix of the logical decoding message.
</p></dd><dt><span class="term">Int32</span></dt><dd><p>
Length of the content.
</p></dd><dt><span class="term">Byte<em class="replaceable"><code>n</code></em></span></dt><dd><p>
The content of the logical decoding message.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-COMMIT"><span class="term">Commit</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-COMMIT" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('C')</span></dt><dd><p>
Identifies the message as a commit message.
</p></dd><dt><span class="term">Int8(0)</span></dt><dd><p>
Flags; currently unused.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the commit.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Commit timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-ORIGIN"><span class="term">Origin</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-ORIGIN" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('O')</span></dt><dd><p>
Identifies the message as an origin message.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the commit on the origin server.
</p></dd><dt><span class="term">String</span></dt><dd><p>
Name of the origin.
</p></dd></dl></div><p>
Note that there can be multiple Origin messages inside a single transaction.
</p></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-RELATION"><span class="term">Relation</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-RELATION" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('R')</span></dt><dd><p>
Identifies the message as a relation message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</p></dd><dt><span class="term">Int32 (Oid)</span></dt><dd><p>
OID of the relation.
</p></dd><dt><span class="term">String</span></dt><dd><p>
Namespace (empty string for <code class="literal">pg_catalog</code>).
</p></dd><dt><span class="term">String</span></dt><dd><p>
Relation name.
</p></dd><dt><span class="term">Int8</span></dt><dd><p>
Replica identity setting for the relation (same as
<code class="structfield">relreplident</code> in <code class="structname">pg_class</code>).
</p></dd><dt><span class="term">Int16</span></dt><dd><p>
Number of columns.
</p></dd></dl></div><p>
Next, the following message part appears for each column included in
the publication (except generated columns):
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Int8</span></dt><dd><p>
Flags for the column. Currently can be either 0 for no flags
or 1 which marks the column as part of the key.
</p></dd><dt><span class="term">String</span></dt><dd><p>
Name of the column.
</p></dd><dt><span class="term">Int32 (Oid)</span></dt><dd><p>
OID of the column's data type.
</p></dd><dt><span class="term">Int32</span></dt><dd><p>
Type modifier of the column (<code class="structfield">atttypmod</code>).
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TYPE"><span class="term">Type</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TYPE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('Y')</span></dt><dd><p>
Identifies the message as a type message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</p></dd><dt><span class="term">Int32 (Oid)</span></dt><dd><p>
OID of the data type.
</p></dd><dt><span class="term">String</span></dt><dd><p>
Namespace (empty string for <code class="literal">pg_catalog</code>).
</p></dd><dt><span class="term">String</span></dt><dd><p>
Name of the data type.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-INSERT"><span class="term">Insert</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-INSERT" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('I')</span></dt><dd><p>
Identifies the message as an insert message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</p></dd><dt><span class="term">Int32 (Oid)</span></dt><dd><p>
OID of the relation corresponding to the ID in the relation
message.
</p></dd><dt><span class="term">Byte1('N')</span></dt><dd><p>
Identifies the following TupleData message as a new tuple.
</p></dd><dt><span class="term">TupleData</span></dt><dd><p>
TupleData message part representing the contents of new tuple.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-UPDATE"><span class="term">Update</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-UPDATE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('U')</span></dt><dd><p>
Identifies the message as an update message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</p></dd><dt><span class="term">Int32 (Oid)</span></dt><dd><p>
OID of the relation corresponding to the ID in the relation
message.
</p></dd><dt><span class="term">Byte1('K')</span></dt><dd><p>
Identifies the following TupleData submessage as a key.
This field is optional and is only present if
the update changed data in any of the column(s) that are
part of the REPLICA IDENTITY index.
</p></dd><dt><span class="term">Byte1('O')</span></dt><dd><p>
Identifies the following TupleData submessage as an old tuple.
This field is optional and is only present if table in which
the update happened has REPLICA IDENTITY set to FULL.
</p></dd><dt><span class="term">TupleData</span></dt><dd><p>
TupleData message part representing the contents of the old tuple
or primary key. Only present if the previous 'O' or 'K' part
is present.
</p></dd><dt><span class="term">Byte1('N')</span></dt><dd><p>
Identifies the following TupleData message as a new tuple.
</p></dd><dt><span class="term">TupleData</span></dt><dd><p>
TupleData message part representing the contents of a new tuple.
</p></dd></dl></div><p>
The Update message may contain either a 'K' message part or an 'O' message part
or neither of them, but never both of them.
</p></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-DELETE"><span class="term">Delete</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-DELETE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('D')</span></dt><dd><p>
Identifies the message as a delete message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</p></dd><dt><span class="term">Int32 (Oid)</span></dt><dd><p>
OID of the relation corresponding to the ID in the relation
message.
</p></dd><dt><span class="term">Byte1('K')</span></dt><dd><p>
Identifies the following TupleData submessage as a key.
This field is present if the table in which the delete has
happened uses an index as REPLICA IDENTITY.
</p></dd><dt><span class="term">Byte1('O')</span></dt><dd><p>
Identifies the following TupleData message as an old tuple.
This field is present if the table in which the delete
happened has REPLICA IDENTITY set to FULL.
</p></dd><dt><span class="term">TupleData</span></dt><dd><p>
TupleData message part representing the contents of the old tuple
or primary key, depending on the previous field.
</p></dd></dl></div><p>
The Delete message may contain either a 'K' message part or an 'O' message part,
but never both of them.
</p></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TRUNCATE"><span class="term">Truncate</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TRUNCATE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('T')</span></dt><dd><p>
Identifies the message as a truncate message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction (only present for streamed transactions).
This field is available since protocol version 2.
</p></dd><dt><span class="term">Int32</span></dt><dd><p>
Number of relations
</p></dd><dt><span class="term">Int8</span></dt><dd><p>
Option bits for <code class="command">TRUNCATE</code>:
1 for <code class="literal">CASCADE</code>, 2 for <code class="literal">RESTART IDENTITY</code>
</p></dd><dt><span class="term">Int32 (Oid)</span></dt><dd><p>
OID of the relation corresponding to the ID in the relation
message. This field is repeated for each relation.
</p></dd></dl></div></dd></dl></div><p>
The following messages (Stream Start, Stream Stop, Stream Commit, and
Stream Abort) are available since protocol version 2.
</p><div class="variablelist"><dl class="variablelist"><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-START"><span class="term">Stream Start</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-START" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('S')</span></dt><dd><p>
Identifies the message as a stream start message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">Int8</span></dt><dd><p>
A value of 1 indicates this is the first stream segment for
this XID, 0 for any other stream segment.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-STOP"><span class="term">Stream Stop</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-STOP" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('E')</span></dt><dd><p>
Identifies the message as a stream stop message.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-COMMIT"><span class="term">Stream Commit</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-COMMIT" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('c')</span></dt><dd><p>
Identifies the message as a stream commit message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">Int8(0)</span></dt><dd><p>
Flags; currently unused.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the commit.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Commit timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-ABORT"><span class="term">Stream Abort</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-ABORT" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('A')</span></dt><dd><p>
Identifies the message as a stream abort message.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the subtransaction (will be same as xid of the transaction for top-level
transactions).
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the abort. This field is available since protocol version
4.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Abort timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01). This field is
available since protocol version 4.
</p></dd></dl></div></dd></dl></div><p>
The following messages (Begin Prepare, Prepare, Commit Prepared, Rollback Prepared, Stream Prepare)
are available since protocol version 3.
</p><div class="variablelist"><dl class="variablelist"><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-BEGIN-PREPARE"><span class="term">Begin Prepare</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-BEGIN-PREPARE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('b')</span></dt><dd><p>
Identifies the message as the beginning of a prepared transaction message.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the prepare.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the prepared transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Prepare timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">String</span></dt><dd><p>
The user defined GID of the prepared transaction.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-PREPARE"><span class="term">Prepare</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-PREPARE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('P')</span></dt><dd><p>
Identifies the message as a prepared transaction message.
</p></dd><dt><span class="term">Int8(0)</span></dt><dd><p>
Flags; currently unused.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the prepare.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the prepared transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Prepare timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">String</span></dt><dd><p>
The user defined GID of the prepared transaction.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-COMMIT-PREPARED"><span class="term">Commit Prepared</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-COMMIT-PREPARED" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('K')</span></dt><dd><p>
Identifies the message as the commit of a prepared transaction message.
</p></dd><dt><span class="term">Int8(0)</span></dt><dd><p>
Flags; currently unused.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the commit of the prepared transaction.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the commit of the prepared transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Commit timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">String</span></dt><dd><p>
The user defined GID of the prepared transaction.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-ROLLBACK-PREPARED"><span class="term">Rollback Prepared</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-ROLLBACK-PREPARED" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('r')</span></dt><dd><p>
Identifies the message as the rollback of a prepared transaction message.
</p></dd><dt><span class="term">Int8(0)</span></dt><dd><p>
Flags; currently unused.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the prepared transaction.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the rollback of the prepared transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Prepare timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Rollback timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">String</span></dt><dd><p>
The user defined GID of the prepared transaction.
</p></dd></dl></div></dd><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-PREPARE"><span class="term">Stream Prepare</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-STREAM-PREPARE" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('p')</span></dt><dd><p>
Identifies the message as a stream prepared transaction message.
</p></dd><dt><span class="term">Int8(0)</span></dt><dd><p>
Flags; currently unused.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The LSN of the prepare.
</p></dd><dt><span class="term">Int64 (XLogRecPtr)</span></dt><dd><p>
The end LSN of the prepared transaction.
</p></dd><dt><span class="term">Int64 (TimestampTz)</span></dt><dd><p>
Prepare timestamp of the transaction. The value is in number
of microseconds since PostgreSQL epoch (2000-01-01).
</p></dd><dt><span class="term">Int32 (TransactionId)</span></dt><dd><p>
Xid of the transaction.
</p></dd><dt><span class="term">String</span></dt><dd><p>
The user defined GID of the prepared transaction.
</p></dd></dl></div></dd></dl></div><p>
The following message parts are shared by the above messages.
</p><div class="variablelist"><dl class="variablelist"><dt id="PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TUPLEDATA"><span class="term">TupleData</span> <a href="#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TUPLEDATA" class="id_link">#</a></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term">Int16</span></dt><dd><p>
Number of columns.
</p></dd></dl></div><p>
Next, one of the following submessages appears for each column (except generated columns):
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('n')</span></dt><dd><p>
Identifies the data as NULL value.
</p></dd></dl></div><p>
Or
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('u')</span></dt><dd><p>
Identifies unchanged TOASTed value (the actual value is not
sent).
</p></dd></dl></div><p>
Or
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('t')</span></dt><dd><p>
Identifies the data as text formatted value.
</p></dd></dl></div><p>
Or
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Byte1('b')</span></dt><dd><p>
Identifies the data as binary formatted value.
</p></dd><dt><span class="term">Int32</span></dt><dd><p>
Length of the column value.
</p></dd><dt><span class="term">Byte<em class="replaceable"><code>n</code></em></span></dt><dd><p>
The value of the column, either in binary or in text format.
(As specified in the preceding format byte).
<em class="replaceable"><code>n</code></em> is the above length.
</p></dd></dl></div><p>
</p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="protocol-error-fields.html" title="55.8. Error and Notice Message Fields">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="protocol.html" title="Chapter 55. Frontend/Backend Protocol">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="protocol-changes.html" title="55.10. Summary of Changes since Protocol 2.0">Next</a></td></tr><tr><td width="40%" align="left" valign="top">55.8. Error and Notice Message Fields </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 55.10. Summary of Changes since Protocol 2.0</td></tr></table></div></body></html>
|