@@ -29,13 +29,6 @@ reinit_master() {
29
29
./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/logfile start
30
30
./install/bin/createdb stas
31
31
./install/bin/psql -c " create table t(id int primary key, v int);"
32
- ./install/bin/psql -c " SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'pglogical_output');"
33
- ./install/bin/psql << SQL
34
- begin;
35
- insert into t values (42);
36
- prepare transaction 'hellyeah';
37
- commit prepared 'hellyeah';
38
- SQL
39
32
}
40
33
41
34
reinit_master2 () {
@@ -69,57 +62,64 @@ reinit_master2() {
69
62
70
63
./install/bin/pg_ctl -sw -D ./install/data2 -l ./install/data2/logfile start
71
64
./install/bin/createdb stas -p5433
72
- # ./install/bin/psql -c "create table t(id int primary key, v int);" -p5433
73
- # ./install/bin/psql -c "SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'pglogical_output');"
74
- # ./install/bin/psql <<SQL
75
- # begin;
76
- # insert into t values (42);
77
- # prepare transaction 'x';
78
- # commit prepared 'x';
79
- # SQL
80
65
}
81
66
82
67
make install > /dev/null
83
68
84
69
cd contrib/pglogical
85
70
make clean && make install
86
71
cd ../..
72
+ cd contrib/pglogical_output
73
+ make clean && make install
74
+ cd ../..
87
75
88
76
pkill -9 postgres
89
77
reinit_master
90
- # reinit_master2
78
+ reinit_master2
79
+
80
+ ./install/bin/psql << SQL
81
+ CREATE EXTENSION pglogical;
82
+ SELECT pglogical.create_node(
83
+ node_name := 'provider1',
84
+ dsn := 'port=5432 dbname=stas'
85
+ );
86
+ SELECT pglogical.replication_set_add_all_tables('default', ARRAY['public']);
87
+ SQL
88
+
89
+ ./install/bin/psql -p 5433 << SQL
90
+ CREATE EXTENSION pglogical;
91
+ SELECT pglogical.create_node(
92
+ node_name := 'subscriber1',
93
+ dsn := 'port=5433 dbname=stas'
94
+ );
95
+ SELECT pglogical.create_subscription(
96
+ subscription_name := 'subscription1',
97
+ provider_dsn := 'port=5432 dbname=stas'
98
+ );
99
+ SQL
100
+
101
+ # ./install/bin/psql -c "SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'pglogical_output');"
91
102
92
103
# ./install/bin/psql <<SQL
93
- # CREATE EXTENSION pglogical;
94
- # SELECT pglogical.create_node(
95
- # node_name := 'provider1',
96
- # dsn := 'port=5432 dbname=stas'
97
- # );
98
- # SELECT pglogical.replication_set_add_all_tables('default', ARRAY['public']);
104
+ # begin;
105
+ # insert into t values (42);
106
+ # prepare transaction 'hellyeah';
107
+ # rollback prepared 'hellyeah';
99
108
# SQL
100
109
101
- # ./install/bin/psql -p 5433 <<SQL
102
- # CREATE EXTENSION pglogical;
103
- # SELECT pglogical.create_node(
104
- # node_name := 'subscriber1',
105
- # dsn := 'port=5433 dbname=stas'
106
- # );
107
- # SELECT pglogical.create_subscription(
108
- # subscription_name := 'subscription1',
109
- # provider_dsn := 'port=5432 dbname=stas'
110
- # );
110
+ # ./install/bin/psql <<SQL
111
+ # SELECT * FROM pg_logical_slot_peek_changes('regression_slot',
112
+ # NULL, NULL,
113
+ # 'expected_encoding', 'UTF8',
114
+ # 'min_proto_version', '1',
115
+ # 'max_proto_version', '1',
116
+ # 'startup_params_format', '1',
117
+ # 'proto_format', 'json',
118
+ # 'no_txinfo', 't');
111
119
# SQL
112
120
113
- ./install/bin/psql << SQL
114
- SELECT * FROM pg_logical_slot_peek_changes('regression_slot',
115
- NULL, NULL,
116
- 'expected_encoding', 'UTF8',
117
- 'min_proto_version', '1',
118
- 'max_proto_version', '1',
119
- 'startup_params_format', '1',
120
- 'proto_format', 'json',
121
- 'no_txinfo', 't');
122
- SQL
121
+
122
+
123
123
124
124
125
125
0 commit comments