Skip to content

Commit 3183e4d

Browse files
committed
reinit
1 parent 97662b2 commit 3183e4d

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

reinit.sh

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ reinit_master() {
2929
./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/logfile start
3030
./install/bin/createdb stas
3131
./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
3932
}
4033

4134
reinit_master2() {
@@ -69,57 +62,64 @@ reinit_master2() {
6962

7063
./install/bin/pg_ctl -sw -D ./install/data2 -l ./install/data2/logfile start
7164
./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
8065
}
8166

8267
make install > /dev/null
8368

8469
cd contrib/pglogical
8570
make clean && make install
8671
cd ../..
72+
cd contrib/pglogical_output
73+
make clean && make install
74+
cd ../..
8775

8876
pkill -9 postgres
8977
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');"
91102

92103
# ./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';
99108
# SQL
100109

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');
111119
# SQL
112120

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+
123123

124124

125125

0 commit comments

Comments
 (0)