@@ -65,7 +65,7 @@ ____________________________________________________________________________-->
65
65
66
66
<programlisting>
67
67
postgres=# SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'include-xids', '0');
68
- location | xid | data
68
+ lsn | xid | data
69
69
-----------+-----+--------------------------------------------------
70
70
0/16D30F8 | 691 | BEGIN
71
71
0/16D32A0 | 691 | table public.data: INSERT: id[int4]:2 data[text]:'arg'
@@ -79,4 +79,48 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'i
79
79
</programlisting>
80
80
</para>
81
81
82
+ <!--==========================orignal english content==========================
83
+ <para>
84
+ We can also get the changes of the in-progress transaction, and the typical
85
+ output might be:
86
+
87
+ <programlisting>
88
+ postgres[33712]=#* SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'stream-changes', '1');
89
+ lsn | xid | data
90
+ -−-−-−-−-−-+-−-−-+-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−-−
91
+ 0/16B21F8 | 503 | opening a streamed block for transaction TXN 503
92
+ 0/16B21F8 | 503 | streaming change for TXN 503
93
+ 0/16B2300 | 503 | streaming change for TXN 503
94
+ 0/16B2408 | 503 | streaming change for TXN 503
95
+ 0/16BEBA0 | 503 | closing a streamed block for transaction TXN 503
96
+ 0/16B21F8 | 503 | opening a streamed block for transaction TXN 503
97
+ 0/16BECA8 | 503 | streaming change for TXN 503
98
+ 0/16BEDB0 | 503 | streaming change for TXN 503
99
+ 0/16BEEB8 | 503 | streaming change for TXN 503
100
+ 0/16BEBA0 | 503 | closing a streamed block for transaction TXN 503
101
+ (10 rows)
102
+ </programlisting>
103
+ </para>
104
+ ____________________________________________________________________________-->
105
+ <para>
106
+ 我们也能获得正在进行事务的改变,典型输出可能是:
107
+
108
+ <programlisting>
109
+ postgres[33712]=#* SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'stream-changes', '1');
110
+ lsn | xid | data
111
+ -----------+-----+--------------------------------------------------
112
+ 0/16B21F8 | 503 | opening a streamed block for transaction TXN 503
113
+ 0/16B21F8 | 503 | streaming change for TXN 503
114
+ 0/16B2300 | 503 | streaming change for TXN 503
115
+ 0/16B2408 | 503 | streaming change for TXN 503
116
+ 0/16BEBA0 | 503 | closing a streamed block for transaction TXN 503
117
+ 0/16B21F8 | 503 | opening a streamed block for transaction TXN 503
118
+ 0/16BECA8 | 503 | streaming change for TXN 503
119
+ 0/16BEDB0 | 503 | streaming change for TXN 503
120
+ 0/16BEEB8 | 503 | streaming change for TXN 503
121
+ 0/16BEBA0 | 503 | closing a streamed block for transaction TXN 503
122
+ (10 rows)
123
+ </programlisting>
124
+ </para>
125
+
82
126
</sect1>
0 commit comments