@@ -16,7 +16,7 @@ sub test_index_replay
16
16
# Wait for standby to catch up
17
17
my $applname =$node_standby -> name;
18
18
my $caughtup_query =
19
- " SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname ';" ;
19
+ " SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname ';" ;
20
20
$node_master -> poll_query_until(' postgres' ,$caughtup_query )
21
21
or die " Timed out while waiting for standby 1 to catch up" ;
22
22
@@ -56,20 +56,25 @@ sub test_index_replay
56
56
# Create some bloom index on master
57
57
$node_master -> psql(" postgres" ," CREATE EXTENSION bloom;" );
58
58
$node_master -> psql(" postgres" ," CREATE TABLE tst (i int4, t text);" );
59
- $node_master -> psql(" postgres" ," INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;" );
60
- $node_master -> psql(" postgres" ," CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);" );
59
+ $node_master -> psql(" postgres" ,
60
+ " INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;"
61
+ );
62
+ $node_master -> psql(" postgres" ,
63
+ " CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);" );
61
64
62
65
# Test that queries give same result
63
66
test_index_replay(' initial' );
64
67
65
68
# Run 10 cycles of table modification. Run test queries after each modification.
66
- for my $i (1.. 10)
69
+ for my $i (1 .. 10)
67
70
{
68
71
$node_master -> psql(" postgres" ," DELETE FROM tst WHERE i =$i ;" );
69
72
test_index_replay(" delete$i " );
70
73
$node_master -> psql(" postgres" ," VACUUM tst;" );
71
74
test_index_replay(" vacuum$i " );
72
75
my ($start ,$end ) = (100001 + ($i - 1) * 10000, 100000 +$i * 10000);
73
- $node_master -> psql(" postgres" ," INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series($start ,$end ) i;" );
76
+ $node_master -> psql(" postgres" ,
77
+ " INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series($start ,$end ) i;"
78
+ );
74
79
test_index_replay(" insert$i " );
75
80
}