1
+ pkill -9 postgres
2
+ rm -rf tmp_install
3
+ make install
4
+ ulimit -c unlimited
5
+
6
+ ./tmp_install/bin/initdb -D ./tmp_install/data1
7
+
8
+ cat<< -CONF >> ./tmp_install/data1/pg_hba.conf
9
+ local replication stas trust
10
+ host replication all ::1/128 trust
11
+ host all all ::1/128 trust
12
+ host replication all 127.0.0.1/32 trust
13
+ host all all 127.0.0.1/32 trust
14
+ CONF
15
+
16
+ cat<< -CONF >> ./tmp_install/data1/postgresql.conf
17
+ max_wal_senders = 10
18
+ wal_level = logical
19
+ max_prepared_transactions = 100
20
+ CONF
21
+
22
+ ./tmp_install/bin/pg_ctl -w -D ./tmp_install/data1 -l logfile start
23
+ createdb -h localhost
24
+ pgbench -i -h localhost
25
+
26
+
27
+ # ##############################################################################
28
+
29
+ ./tmp_install/bin/initdb -D ./tmp_install/data2
30
+
31
+ cat<< -CONF >> ./tmp_install/data2/pg_hba.conf
32
+ local replication stas trust
33
+ host replication all ::1/128 trust
34
+ host all all ::1/128 trust
35
+ host replication all 127.0.0.1/32 trust
36
+ host all all 127.0.0.1/32 trust
37
+ CONF
38
+
39
+ cat<< -CONF >> ./tmp_install/data2/postgresql.conf
40
+ max_wal_senders = 10
41
+ wal_level = logical
42
+ max_prepared_transactions = 100
43
+ port = 5433
44
+ CONF
45
+
46
+ ./tmp_install/bin/pg_ctl -w -D ./tmp_install/data2 -l logfile2 start
47
+ createdb -h localhost -p 5433
48
+ ./tmp_install/bin/pg_dump -s| psql -p 5433
49
+ # pgbench -i -h localhost -p 5433
50
+
51
+
52
+ psql -c$' CREATE PUBLICATION mypub FOR TABLE pgbench_accounts, pgbench_branches, pgbench_history, pgbench_tellers;'
53
+ psql -c$' CREATE SUBSCRIPTION mysub CONNECTION\' dbname=stas host=127.0.0.1\' PUBLICATION mypub;' -p 5433