Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab26048

Browse files
committed
support scripts
1 parentf097562 commitab26048

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

‎repconsumer.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
importpsycopg2
2+
frompsycopg2.extrasimportLogicalReplicationConnection
3+
4+
conn=psycopg2.connect("dbname=regression",connection_factory=LogicalReplicationConnection)
5+
cur=conn.cursor()
6+
7+
cur.create_replication_slot("slotpy",
8+
slot_type=psycopg2.extras.REPLICATION_LOGICAL,
9+
output_plugin='test_decoding')
10+
11+
cur.start_replication("slotpy")
12+
13+
defconsumer(msg):
14+
print(msg.payload)
15+
16+
cur.consume_stream(consumer)
17+

‎runtest.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
# this script assumes that postgres and test_decodong is installed
4+
# (srcdir)/tmp_install
5+
6+
rm -rf tmp_install/data1
7+
./tmp_install/bin/initdb -D ./tmp_install/data1
8+
./tmp_install/bin/pg_ctl -w -D ./tmp_install/data1 -l logfile start
9+
./tmp_install/bin/createdb regression
10+
11+
cat>> ./tmp_install/data1/postgresql.conf<<-CONF
12+
wal_level=logical
13+
max_replication_slots=4
14+
max_prepared_transactions=20
15+
shared_preload_libraries='test_decoding'
16+
wal_sender_timeout=600000
17+
CONF
18+
./tmp_install/bin/pg_ctl -w -D ./tmp_install/data1 -l logfile restart
19+
20+
python3 repconsumer.py> xlog_decoded&
21+
REPCONSUMER_PID=$!
22+
23+
sleep 3
24+
25+
cd src/test/regress
26+
27+
# ./pg_regress --inputdir=. --bindir='../../../tmp_install/bin' --dlpath=. --schedule=./parallel_schedule --use-existing
28+
29+
./pg_regress --inputdir=. --bindir='../../../tmp_install/bin' --dlpath=. --schedule=./serial_schedule --use-existing
30+
31+
cd ../../..
32+
33+
kill$REPCONSUMER_PID
34+
./tmp_install/bin/pg_ctl -D ./tmp_install/data1 -l logfile stop

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp