File: selecttable.out

package info (click to toggle)
wal2json 2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,672 kB
  • sloc: ansic: 2,524; sql: 1,136; makefile: 27; sh: 6
file content (156 lines) | stat: -rw-r--r-- 10,233 bytes parent folder | download | duplicates (4)
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
\set VERBOSITY terse
-- predictability
SET synchronous_commit = on;
DROP TABLE IF EXISTS select_table_1;
NOTICE:  table "select_table_1" does not exist, skipping
DROP TABLE IF EXISTS select_table_2;
NOTICE:  table "select_table_2" does not exist, skipping
DROP TABLE IF EXISTS select_table_3;
NOTICE:  table "select_table_3" does not exist, skipping
DROP SCHEMA IF EXISTS select_schema_1 CASCADE;
NOTICE:  schema "select_schema_1" does not exist, skipping
DROP SCHEMA IF EXISTS select_schema_2 CASCADE;
NOTICE:  schema "select_schema_2" does not exist, skipping
CREATE SCHEMA select_schema_1;
CREATE SCHEMA select_schema_2;
CREATE TABLE select_table_1 (a integer, b text, primary key(a));
CREATE TABLE select_schema_1.select_table_1 (a integer, b text, primary key(a));
CREATE TABLE select_schema_1.select_table_2 (a integer, b text, primary key(a));
CREATE TABLE select_schema_2.select_table_1 (a integer, b text, primary key(a));
CREATE TABLE select_schema_2.select_table_2 (a integer, b text, primary key(a));
CREATE TABLE select_schema_2.select_table_3 (a integer, b text, primary key(a));
CREATE TABLE select_table_2 (a integer, b text, primary key(a));
CREATE TABLE select_table_3 (a integer, b text, primary key(a));
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json');
 ?column? 
----------
 init
(1 row)

INSERT INTO select_table_1 (a, b) VALUES(1, 'public.select_table_1');
INSERT INTO select_schema_1.select_table_1 (a, b) VALUES(1, 'select_schema_1.select_table_1');
INSERT INTO select_schema_1.select_table_2 (a, b) VALUES(1, 'select_schema_1.select_table_2');
INSERT INTO select_schema_2.select_table_1 (a, b) VALUES(1, 'select_schema_2.select_table_1');
INSERT INTO select_schema_2.select_table_2 (a, b) VALUES(1, 'select_schema_2.select_table_2');
INSERT INTO select_schema_2.select_table_3 (a, b) VALUES(1, 'select_schema_2.select_table_3');
INSERT INTO select_table_2 (a, b) VALUES(1, 'public.select_table_2');
INSERT INTO select_table_3 (a, b) VALUES(1, 'public.select_table_3');
SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'add-tables', '   foo.bar,*.select_table_1  ,select_schema_2.* , public.select_table_3  ');
                                     data                                      
-------------------------------------------------------------------------------
 {                                                                            +
         "change": [                                                          +
                 {                                                            +
                         "kind": "insert",                                    +
                         "schema": "public",                                  +
                         "table": "select_table_1",                           +
                         "columnnames": ["a", "b"],                           +
                         "columntypes": ["integer", "text"],                  +
                         "columnvalues": [1, "public.select_table_1"]         +
                 }                                                            +
         ]                                                                    +
 }
 {                                                                            +
         "change": [                                                          +
                 {                                                            +
                         "kind": "insert",                                    +
                         "schema": "select_schema_1",                         +
                         "table": "select_table_1",                           +
                         "columnnames": ["a", "b"],                           +
                         "columntypes": ["integer", "text"],                  +
                         "columnvalues": [1, "select_schema_1.select_table_1"]+
                 }                                                            +
         ]                                                                    +
 }
 {                                                                            +
         "change": [                                                          +
         ]                                                                    +
 }
 {                                                                            +
         "change": [                                                          +
                 {                                                            +
                         "kind": "insert",                                    +
                         "schema": "select_schema_2",                         +
                         "table": "select_table_1",                           +
                         "columnnames": ["a", "b"],                           +
                         "columntypes": ["integer", "text"],                  +
                         "columnvalues": [1, "select_schema_2.select_table_1"]+
                 }                                                            +
         ]                                                                    +
 }
 {                                                                            +
         "change": [                                                          +
                 {                                                            +
                         "kind": "insert",                                    +
                         "schema": "select_schema_2",                         +
                         "table": "select_table_2",                           +
                         "columnnames": ["a", "b"],                           +
                         "columntypes": ["integer", "text"],                  +
                         "columnvalues": [1, "select_schema_2.select_table_2"]+
                 }                                                            +
         ]                                                                    +
 }
 {                                                                            +
         "change": [                                                          +
                 {                                                            +
                         "kind": "insert",                                    +
                         "schema": "select_schema_2",                         +
                         "table": "select_table_3",                           +
                         "columnnames": ["a", "b"],                           +
                         "columntypes": ["integer", "text"],                  +
                         "columnvalues": [1, "select_schema_2.select_table_3"]+
                 }                                                            +
         ]                                                                    +
 }
 {                                                                            +
         "change": [                                                          +
         ]                                                                    +
 }
 {                                                                            +
         "change": [                                                          +
                 {                                                            +
                         "kind": "insert",                                    +
                         "schema": "public",                                  +
                         "table": "select_table_3",                           +
                         "columnnames": ["a", "b"],                           +
                         "columntypes": ["integer", "text"],                  +
                         "columnvalues": [1, "public.select_table_3"]         +
                 }                                                            +
         ]                                                                    +
 }
(8 rows)

SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'add-tables', '   foo.bar,*.select_table_1  ,select_schema_2.* , public.select_table_3  ');
                                                                                            data                                                                                            
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 {"action":"B"}
 {"action":"I","schema":"public","table":"select_table_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"public.select_table_1"}]}
 {"action":"C"}
 {"action":"B"}
 {"action":"I","schema":"select_schema_1","table":"select_table_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_1.select_table_1"}]}
 {"action":"C"}
 {"action":"B"}
 {"action":"C"}
 {"action":"B"}
 {"action":"I","schema":"select_schema_2","table":"select_table_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_2.select_table_1"}]}
 {"action":"C"}
 {"action":"B"}
 {"action":"I","schema":"select_schema_2","table":"select_table_2","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_2.select_table_2"}]}
 {"action":"C"}
 {"action":"B"}
 {"action":"I","schema":"select_schema_2","table":"select_table_3","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_2.select_table_3"}]}
 {"action":"C"}
 {"action":"B"}
 {"action":"C"}
 {"action":"B"}
 {"action":"I","schema":"public","table":"select_table_3","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"public.select_table_3"}]}
 {"action":"C"}
(22 rows)

SELECT 'stop' FROM pg_drop_replication_slot('regression_slot');
 ?column? 
----------
 stop
(1 row)