@@ -2797,9 +2797,11 @@ The commands accepted in replication mode are:
2797
2797
</term>
2798
2798
<listitem>
2799
2799
<para>
2800
- Protocol version. Currently only version <literal>1</literal> is
2801
- supported.
2802
- </para>
2800
+ Protocol version. Currently versions <literal>1</literal> and
2801
+ <literal>2</literal> are supported. The version <literal>2</literal>
2802
+ is supported only for server version 14 and above, and it allows
2803
+ streaming of large in-progress transactions.
2804
+ </para>
2803
2805
</listitem>
2804
2806
</varlistentry>
2805
2807
@@ -2855,7 +2857,10 @@ The commands accepted in replication mode are:
2855
2857
<para>
2856
2858
The logical replication protocol sends individual transactions one by one.
2857
2859
This means that all messages between a pair of Begin and Commit messages
2858
- belong to the same transaction.
2860
+ belong to the same transaction. It also sends changes of large in-progress
2861
+ transactions between a pair of Stream Start and Stream Stop messages. The
2862
+ last stream of such a transaction contains Stream Commit or Stream Abort
2863
+ message.
2859
2864
</para>
2860
2865
2861
2866
<para>
@@ -6457,8 +6462,8 @@ Message
6457
6462
</term>
6458
6463
<listitem>
6459
6464
<para>
6460
- Xid of the transaction. The XID is sent only when user has
6461
- requested streaming of in-progress transactions .
6465
+ Xid of the transaction ( only present for streamed transactions).
6466
+ This field is available since protocol version 2 .
6462
6467
</para>
6463
6468
</listitem>
6464
6469
</varlistentry>
@@ -6646,6 +6651,17 @@ Relation
6646
6651
Int32
6647
6652
</term>
6648
6653
<listitem>
6654
+ <para>
6655
+ Xid of the transaction (only present for streamed transactions).
6656
+ This field is available since protocol version 2.
6657
+ </para>
6658
+ </listitem>
6659
+ </varlistentry>
6660
+ <varlistentry>
6661
+ <term>
6662
+ Int32
6663
+ </term>
6664
+ <listitem>
6649
6665
<para>
6650
6666
ID of the relation.
6651
6667
</para>
@@ -6767,6 +6783,17 @@ Type
6767
6783
Int32
6768
6784
</term>
6769
6785
<listitem>
6786
+ <para>
6787
+ Xid of the transaction (only present for streamed transactions).
6788
+ This field is available since protocol version 2.
6789
+ </para>
6790
+ </listitem>
6791
+ </varlistentry>
6792
+ <varlistentry>
6793
+ <term>
6794
+ Int32
6795
+ </term>
6796
+ <listitem>
6770
6797
<para>
6771
6798
ID of the data type.
6772
6799
</para>
@@ -6821,6 +6848,17 @@ Insert
6821
6848
Int32
6822
6849
</term>
6823
6850
<listitem>
6851
+ <para>
6852
+ Xid of the transaction (only present for streamed transactions).
6853
+ This field is available since protocol version 2.
6854
+ </para>
6855
+ </listitem>
6856
+ </varlistentry>
6857
+ <varlistentry>
6858
+ <term>
6859
+ Int32
6860
+ </term>
6861
+ <listitem>
6824
6862
<para>
6825
6863
ID of the relation corresponding to the ID in the relation
6826
6864
message.
@@ -6877,6 +6915,17 @@ Update
6877
6915
Int32
6878
6916
</term>
6879
6917
<listitem>
6918
+ <para>
6919
+ Xid of the transaction (only present for streamed transactions).
6920
+ This field is available since protocol version 2.
6921
+ </para>
6922
+ </listitem>
6923
+ </varlistentry>
6924
+ <varlistentry>
6925
+ <term>
6926
+ Int32
6927
+ </term>
6928
+ <listitem>
6880
6929
<para>
6881
6930
ID of the relation corresponding to the ID in the relation
6882
6931
message.
@@ -6980,6 +7029,17 @@ Delete
6980
7029
Int32
6981
7030
</term>
6982
7031
<listitem>
7032
+ <para>
7033
+ Xid of the transaction (only present for streamed transactions).
7034
+ This field is available since protocol version 2.
7035
+ </para>
7036
+ </listitem>
7037
+ </varlistentry>
7038
+ <varlistentry>
7039
+ <term>
7040
+ Int32
7041
+ </term>
7042
+ <listitem>
6983
7043
<para>
6984
7044
ID of the relation corresponding to the ID in the relation
6985
7045
message.
@@ -7058,6 +7118,17 @@ Truncate
7058
7118
Int32
7059
7119
</term>
7060
7120
<listitem>
7121
+ <para>
7122
+ Xid of the transaction (only present for streamed transactions).
7123
+ This field is available since protocol version 2.
7124
+ </para>
7125
+ </listitem>
7126
+ </varlistentry>
7127
+ <varlistentry>
7128
+ <term>
7129
+ Int32
7130
+ </term>
7131
+ <listitem>
7061
7132
<para>
7062
7133
Number of relations
7063
7134
</para>
@@ -7095,6 +7166,206 @@ Truncate
7095
7166
7096
7167
<para>
7097
7168
7169
+ The following messages (Stream Start, Stream End, Stream Commit, and
7170
+ Stream Abort) are available since protocol version 2.
7171
+
7172
+ </para>
7173
+
7174
+ <variablelist>
7175
+
7176
+ <varlistentry>
7177
+ <term>
7178
+ Stream Start
7179
+ </term>
7180
+ <listitem>
7181
+ <para>
7182
+
7183
+ <variablelist>
7184
+ <varlistentry>
7185
+ <term>
7186
+ Byte1('S')
7187
+ </term>
7188
+ <listitem>
7189
+ <para>
7190
+ Identifies the message as a stream start message.
7191
+ </para>
7192
+ </listitem>
7193
+ </varlistentry>
7194
+ <varlistentry>
7195
+ <term>
7196
+ Int32
7197
+ </term>
7198
+ <listitem>
7199
+ <para>
7200
+ Xid of the transaction.
7201
+ </para>
7202
+ </listitem>
7203
+ </varlistentry>
7204
+ <varlistentry>
7205
+ <term>
7206
+ Int8
7207
+ </term>
7208
+ <listitem>
7209
+ <para>
7210
+ A value of 1 indicates this is the first stream segment for
7211
+ this XID, 0 for any other stream segment.
7212
+ </para>
7213
+ </listitem>
7214
+ </varlistentry>
7215
+
7216
+ </variablelist>
7217
+ </para>
7218
+ </listitem>
7219
+ </varlistentry>
7220
+
7221
+ <varlistentry>
7222
+ <term>
7223
+ Stream Stop
7224
+ </term>
7225
+ <listitem>
7226
+ <para>
7227
+
7228
+ <variablelist>
7229
+ <varlistentry>
7230
+ <term>
7231
+ Byte1('E')
7232
+ </term>
7233
+ <listitem>
7234
+ <para>
7235
+ Identifies the message as a stream stop message.
7236
+ </para>
7237
+ </listitem>
7238
+ </varlistentry>
7239
+
7240
+ </variablelist>
7241
+ </para>
7242
+ </listitem>
7243
+ </varlistentry>
7244
+
7245
+ <varlistentry>
7246
+ <term>
7247
+ Stream Commit
7248
+ </term>
7249
+ <listitem>
7250
+ <para>
7251
+
7252
+ <variablelist>
7253
+ <varlistentry>
7254
+ <term>
7255
+ Byte1('c')
7256
+ </term>
7257
+ <listitem>
7258
+ <para>
7259
+ Identifies the message as a stream commit message.
7260
+ </para>
7261
+ </listitem>
7262
+ </varlistentry>
7263
+ <varlistentry>
7264
+ <term>
7265
+ Int32
7266
+ </term>
7267
+ <listitem>
7268
+ <para>
7269
+ Xid of the transaction.
7270
+ </para>
7271
+ </listitem>
7272
+ </varlistentry>
7273
+ <varlistentry>
7274
+ <term>
7275
+ Int8
7276
+ </term>
7277
+ <listitem>
7278
+ <para>
7279
+ Flags; currently unused (must be 0).
7280
+ </para>
7281
+ </listitem>
7282
+ </varlistentry>
7283
+ <varlistentry>
7284
+ <term>
7285
+ Int64
7286
+ </term>
7287
+ <listitem>
7288
+ <para>
7289
+ The LSN of the commit.
7290
+ </para>
7291
+ </listitem>
7292
+ </varlistentry>
7293
+ <varlistentry>
7294
+ <term>
7295
+ Int64
7296
+ </term>
7297
+ <listitem>
7298
+ <para>
7299
+ The end LSN of the transaction.
7300
+ </para>
7301
+ </listitem>
7302
+ </varlistentry>
7303
+ <varlistentry>
7304
+ <term>
7305
+ Int64
7306
+ </term>
7307
+ <listitem>
7308
+ <para>
7309
+ Commit timestamp of the transaction. The value is in number
7310
+ of microseconds since PostgreSQL epoch (2000-01-01).
7311
+ </para>
7312
+ </listitem>
7313
+ </varlistentry>
7314
+
7315
+ </variablelist>
7316
+ </para>
7317
+ </listitem>
7318
+ </varlistentry>
7319
+
7320
+ <varlistentry>
7321
+ <term>
7322
+ Stream Abort
7323
+ </term>
7324
+ <listitem>
7325
+ <para>
7326
+
7327
+ <variablelist>
7328
+ <varlistentry>
7329
+ <term>
7330
+ Byte1('A')
7331
+ </term>
7332
+ <listitem>
7333
+ <para>
7334
+ Identifies the message as a stream abort message.
7335
+ </para>
7336
+ </listitem>
7337
+ </varlistentry>
7338
+ <varlistentry>
7339
+ <term>
7340
+ Int32
7341
+ </term>
7342
+ <listitem>
7343
+ <para>
7344
+ Xid of the transaction.
7345
+ </para>
7346
+ </listitem>
7347
+ </varlistentry>
7348
+ <varlistentry>
7349
+ <term>
7350
+ Int32
7351
+ </term>
7352
+ <listitem>
7353
+ <para>
7354
+ Xid of the subtransaction (will be same as xid of the transaction for top-level
7355
+ transactions).
7356
+ </para>
7357
+ </listitem>
7358
+ </varlistentry>
7359
+
7360
+ </variablelist>
7361
+ </para>
7362
+ </listitem>
7363
+ </varlistentry>
7364
+
7365
+ </variablelist>
7366
+
7367
+ <para>
7368
+
7098
7369
The following message parts are shared by the above messages.
7099
7370
7100
7371
</para>
0 commit comments