|
19 | 19 | $node_publisher->safe_psql('postgres',
|
20 | 20 | "CREATE TABLE tab_fk (bid int PRIMARY KEY);");
|
21 | 21 | $node_publisher->safe_psql('postgres',
|
22 |
| -"CREATE TABLE tab_fk_ref (id int PRIMARY KEY, bid int REFERENCES tab_fk (bid));" |
| 22 | +"CREATE TABLE tab_fk_ref (id int PRIMARY KEY, junk text, bid int REFERENCES tab_fk (bid));" |
23 | 23 | );
|
24 | 24 |
|
25 |
| -# Setup structure on subscriber |
| 25 | +# Setup structure on subscriber; column order intentionally different |
26 | 26 | $node_subscriber->safe_psql('postgres',
|
27 | 27 | "CREATE TABLE tab_fk (bid int PRIMARY KEY);");
|
28 | 28 | $node_subscriber->safe_psql('postgres',
|
29 |
| -"CREATE TABLE tab_fk_ref (id int PRIMARY KEY, bid int REFERENCES tab_fk (bid));" |
| 29 | +"CREATE TABLE tab_fk_ref (id int PRIMARY KEY, bid int REFERENCES tab_fk (bid), junk text);" |
30 | 30 | );
|
31 | 31 |
|
32 | 32 | # Setup logical replication
|
|
47 | 47 |
|
48 | 48 | $node_publisher->safe_psql('postgres',
|
49 | 49 | "INSERT INTO tab_fk (bid) VALUES (1);");
|
| 50 | +# "junk" value is meant to be large enough to force out-of-line storage |
50 | 51 | $node_publisher->safe_psql('postgres',
|
51 |
| - "INSERT INTO tab_fk_ref (id, bid) VALUES (1, 1);"); |
| 52 | + "INSERT INTO tab_fk_ref (id, bid, junk) VALUES (1, 1, repeat(pi()::text,20000));" |
| 53 | +); |
52 | 54 |
|
53 | 55 | $node_publisher->poll_query_until('postgres', $caughtup_query)
|
54 | 56 | or die "Timed out while waiting for subscriber to catch up";
|
@@ -136,7 +138,8 @@ BEGIN
|
136 | 138 |
|
137 | 139 | $result = $node_subscriber->safe_psql('postgres',
|
138 | 140 | "SELECT count(*), min(id), max(id) FROM tab_fk_ref;");
|
139 |
| -is($result, qq(2|1|2), 'check column trigger applied on even for other column'); |
| 141 | +is($result, qq(2|1|2), |
| 142 | + 'check column trigger applied even on update for other column'); |
140 | 143 |
|
141 | 144 | $node_subscriber->stop('fast');
|
142 | 145 | $node_publisher->stop('fast');
|
0 commit comments