@@ -39,7 +39,7 @@ INSERT INTO test_prepared2 VALUES (9);
39
39
DROP TABLE test_prepared1;
40
40
DROP TABLE test_prepared2;
41
41
-- show results
42
- SELECT data FROMpg_logical_slot_get_changes ('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
42
+ SELECT data FROMpg_logical_slot_peek_changes ('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
43
43
data
44
44
-------------------------------------------------------------------------
45
45
BEGIN
@@ -66,6 +66,39 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
66
66
COMMIT
67
67
(22 rows)
68
68
69
+ -- same but with twophase decoding
70
+ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'twophase-decoding', '1');
71
+ data
72
+ -------------------------------------------------------------------------
73
+ BEGIN
74
+ table public.test_prepared1: INSERT: id[integer]:1
75
+ PREPARE 'test_prepared#1'
76
+ COMMIT PREPARED 'test_prepared#1'
77
+ BEGIN
78
+ table public.test_prepared1: INSERT: id[integer]:2
79
+ COMMIT
80
+ BEGIN
81
+ table public.test_prepared1: INSERT: id[integer]:3
82
+ PREPARE 'test_prepared#2'
83
+ ABORT PREPARED 'test_prepared#2'
84
+ BEGIN
85
+ table public.test_prepared1: INSERT: id[integer]:4
86
+ COMMIT
87
+ BEGIN
88
+ table public.test_prepared1: INSERT: id[integer]:5
89
+ table public.test_prepared1: INSERT: id[integer]:6 data[text]:'frakbar'
90
+ PREPARE 'test_prepared#3'
91
+ BEGIN
92
+ table public.test_prepared2: INSERT: id[integer]:7
93
+ COMMIT
94
+ BEGIN
95
+ table public.test_prepared1: INSERT: id[integer]:8 data[text]:null
96
+ COMMIT
97
+ BEGIN
98
+ table public.test_prepared2: INSERT: id[integer]:9
99
+ COMMIT
100
+ (27 rows)
101
+
69
102
SELECT pg_drop_replication_slot('regression_slot');
70
103
pg_drop_replication_slot
71
104
--------------------------