@@ -2811,11 +2811,17 @@ The commands accepted in replication mode are:
2811
2811
</term>
2812
2812
<listitem>
2813
2813
<para>
2814
- Protocol version. Currently versions <literal>1</literal> and
2815
- <literal>2</literal> are supported. The version <literal>2</literal>
2816
- is supported only for server version 14 and above, and it allows
2817
- streaming of large in-progress transactions.
2818
- </para>
2814
+ Protocol version. Currently versions <literal>1</literal>, <literal>2</literal>,
2815
+ and <literal>3</literal> are supported.
2816
+ </para>
2817
+ <para>
2818
+ Version <literal>2</literal> is supported only for server version 14
2819
+ and above, and it allows streaming of large in-progress transactions.
2820
+ </para>
2821
+ <para>
2822
+ Version <literal>3</literal> is supported only for server version 15
2823
+ and above, and it allows streaming of two-phase transactions.
2824
+ </para>
2819
2825
</listitem>
2820
2826
</varlistentry>
2821
2827
@@ -2871,10 +2877,11 @@ The commands accepted in replication mode are:
2871
2877
<para>
2872
2878
The logical replication protocol sends individual transactions one by one.
2873
2879
This means that all messages between a pair of Begin and Commit messages
2874
- belong to the same transaction. It also sends changes of large in-progress
2875
- transactions between a pair of Stream Start and Stream Stop messages. The
2876
- last stream of such a transaction contains Stream Commit or Stream Abort
2877
- message.
2880
+ belong to the same transaction. Similarly, all messages between a pair of
2881
+ Begin Prepare and Prepare messages belong to the same transaction.
2882
+ It also sends changes of large in-progress transactions between a pair of
2883
+ Stream Start and Stream Stop messages. The last stream of such a transaction
2884
+ contains a Stream Commit or Stream Abort message.
2878
2885
</para>
2879
2886
2880
2887
<para>
@@ -7390,6 +7397,272 @@ Stream Abort
7390
7397
7391
7398
</variablelist>
7392
7399
7400
+ <para>
7401
+ The following messages (Begin Prepare, Prepare, Commit Prepared, Rollback Prepared)
7402
+ are available since protocol version 3.
7403
+ </para>
7404
+
7405
+ <variablelist>
7406
+
7407
+ <varlistentry>
7408
+
7409
+ <term>Begin Prepare</term>
7410
+ <listitem>
7411
+ <para>
7412
+
7413
+ <variablelist>
7414
+
7415
+ <varlistentry>
7416
+ <term>Byte1('b')</term>
7417
+ <listitem><para>
7418
+ Identifies the message as the beginning of a two-phase transaction message.
7419
+ </para></listitem>
7420
+ </varlistentry>
7421
+
7422
+ <varlistentry>
7423
+ <term>Int64</term>
7424
+ <listitem><para>
7425
+ The LSN of the prepare.
7426
+ </para></listitem>
7427
+ </varlistentry>
7428
+
7429
+ <varlistentry>
7430
+ <term>Int64</term>
7431
+ <listitem><para>
7432
+ The end LSN of the prepared transaction.
7433
+ </para></listitem>
7434
+ </varlistentry>
7435
+
7436
+ <varlistentry>
7437
+ <term>Int64</term>
7438
+ <listitem><para>
7439
+ Prepare timestamp of the transaction. The value is in number
7440
+ of microseconds since PostgreSQL epoch (2000-01-01).
7441
+ </para></listitem>
7442
+ </varlistentry>
7443
+
7444
+ <varlistentry>
7445
+ <term>Int32</term>
7446
+ <listitem><para>
7447
+ Xid of the transaction.
7448
+ </para></listitem>
7449
+ </varlistentry>
7450
+
7451
+ <varlistentry>
7452
+ <term>String</term>
7453
+ <listitem><para>
7454
+ The user defined GID of the two-phase transaction.
7455
+ </para></listitem>
7456
+ </varlistentry>
7457
+
7458
+ </variablelist>
7459
+
7460
+ </para>
7461
+ </listitem>
7462
+ </varlistentry>
7463
+
7464
+ <varlistentry>
7465
+
7466
+ <term>Prepare</term>
7467
+ <listitem>
7468
+ <para>
7469
+
7470
+ <variablelist>
7471
+
7472
+ <varlistentry>
7473
+ <term>Byte1('P')</term>
7474
+ <listitem><para>
7475
+ Identifies the message as a two-phase prepared transaction message.
7476
+ </para></listitem>
7477
+ </varlistentry>
7478
+
7479
+ <varlistentry>
7480
+ <term>Int8</term>
7481
+ <listitem><para>
7482
+ Flags; currently unused (must be 0).
7483
+ </para></listitem>
7484
+ </varlistentry>
7485
+
7486
+ <varlistentry>
7487
+ <term>Int64</term>
7488
+ <listitem><para>
7489
+ The LSN of the prepare.
7490
+ </para></listitem>
7491
+ </varlistentry>
7492
+
7493
+ <varlistentry>
7494
+ <term>Int64</term>
7495
+ <listitem><para>
7496
+ The end LSN of the prepared transaction.
7497
+ </para></listitem>
7498
+ </varlistentry>
7499
+
7500
+ <varlistentry>
7501
+ <term>Int64</term>
7502
+ <listitem><para>
7503
+ Prepare timestamp of the transaction. The value is in number
7504
+ of microseconds since PostgreSQL epoch (2000-01-01).
7505
+ </para></listitem>
7506
+ </varlistentry>
7507
+
7508
+ <varlistentry>
7509
+ <term>Int32</term>
7510
+ <listitem><para>
7511
+ Xid of the transaction.
7512
+ </para></listitem>
7513
+ </varlistentry>
7514
+
7515
+ <varlistentry>
7516
+ <term>String</term>
7517
+ <listitem><para>
7518
+ The user defined GID of the two-phase transaction.
7519
+ </para></listitem>
7520
+ </varlistentry>
7521
+
7522
+ </variablelist>
7523
+
7524
+ </para>
7525
+ </listitem>
7526
+ </varlistentry>
7527
+
7528
+ <varlistentry>
7529
+
7530
+ <term>Commit Prepared</term>
7531
+ <listitem>
7532
+ <para>
7533
+
7534
+ <variablelist>
7535
+
7536
+ <varlistentry>
7537
+ <term>Byte1('K')</term>
7538
+ <listitem><para>
7539
+ Identifies the message as the commit of a two-phase transaction message.
7540
+ </para></listitem>
7541
+ </varlistentry>
7542
+
7543
+ <varlistentry>
7544
+ <term>Int8</term>
7545
+ <listitem><para>
7546
+ Flags; currently unused (must be 0).
7547
+ </para></listitem>
7548
+ </varlistentry>
7549
+
7550
+ <varlistentry>
7551
+ <term>Int64</term>
7552
+ <listitem><para>
7553
+ The LSN of the commit prepared.
7554
+ </para></listitem>
7555
+ </varlistentry>
7556
+
7557
+ <varlistentry>
7558
+ <term>Int64</term>
7559
+ <listitem><para>
7560
+ The end LSN of the commit prepared transaction.
7561
+ </para></listitem>
7562
+ </varlistentry>
7563
+
7564
+ <varlistentry>
7565
+ <term>Int64</term>
7566
+ <listitem><para>
7567
+ Commit timestamp of the transaction. The value is in number
7568
+ of microseconds since PostgreSQL epoch (2000-01-01).
7569
+ </para></listitem>
7570
+ </varlistentry>
7571
+
7572
+ <varlistentry>
7573
+ <term>Int32</term>
7574
+ <listitem><para>
7575
+ Xid of the transaction.
7576
+ </para></listitem>
7577
+ </varlistentry>
7578
+
7579
+ <varlistentry>
7580
+ <term>String</term>
7581
+ <listitem><para>
7582
+ The user defined GID of the two-phase transaction.
7583
+ </para></listitem>
7584
+ </varlistentry>
7585
+
7586
+ </variablelist>
7587
+
7588
+ </para>
7589
+ </listitem>
7590
+ </varlistentry>
7591
+
7592
+ <varlistentry>
7593
+
7594
+ <term>Rollback Prepared</term>
7595
+ <listitem>
7596
+ <para>
7597
+
7598
+ <variablelist>
7599
+
7600
+ <varlistentry>
7601
+ <term>Byte1('r')</term>
7602
+ <listitem><para>
7603
+ Identifies the message as the rollback of a two-phase transaction message.
7604
+ </para></listitem>
7605
+ </varlistentry>
7606
+
7607
+ <varlistentry>
7608
+ <term>Int8</term>
7609
+ <listitem><para>
7610
+ Flags; currently unused (must be 0).
7611
+ </para></listitem>
7612
+ </varlistentry>
7613
+
7614
+ <varlistentry>
7615
+ <term>Int64</term>
7616
+ <listitem><para>
7617
+ The end LSN of the prepared transaction.
7618
+ </para></listitem>
7619
+ </varlistentry>
7620
+
7621
+ <varlistentry>
7622
+ <term>Int64</term>
7623
+ <listitem><para>
7624
+ The end LSN of the rollback prepared transaction.
7625
+ </para></listitem>
7626
+ </varlistentry>
7627
+
7628
+ <varlistentry>
7629
+ <term>Int64</term>
7630
+ <listitem><para>
7631
+ Prepare timestamp of the transaction. The value is in number
7632
+ of microseconds since PostgreSQL epoch (2000-01-01).
7633
+ </para></listitem>
7634
+ </varlistentry>
7635
+
7636
+ <varlistentry>
7637
+ <term>Int64</term>
7638
+ <listitem><para>
7639
+ Rollback timestamp of the transaction. The value is in number
7640
+ of microseconds since PostgreSQL epoch (2000-01-01).
7641
+ </para></listitem>
7642
+ </varlistentry>
7643
+
7644
+ <varlistentry>
7645
+ <term>Int32</term>
7646
+ <listitem><para>
7647
+ Xid of the transaction.
7648
+ </para></listitem>
7649
+ </varlistentry>
7650
+
7651
+ <varlistentry>
7652
+ <term>String</term>
7653
+ <listitem><para>
7654
+ The user defined GID of the two-phase transaction.
7655
+ </para></listitem>
7656
+ </varlistentry>
7657
+
7658
+ </variablelist>
7659
+
7660
+ </para>
7661
+ </listitem>
7662
+ </varlistentry>
7663
+
7664
+ </variablelist>
7665
+
7393
7666
<para>
7394
7667
7395
7668
The following message parts are shared by the above messages.
0 commit comments