|
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
|
|
43 | 43 |
|
44 | 44 | $node_publisher->safe_psql('postgres',
|
45 | 45 | "INSERT INTO tab_fk (bid) VALUES (1);");
|
| 46 | +# "junk" value is meant to be large enough to force out-of-line storage |
46 | 47 | $node_publisher->safe_psql('postgres',
|
47 |
| - "INSERT INTO tab_fk_ref (id, bid) VALUES (1, 1);"); |
| 48 | + "INSERT INTO tab_fk_ref (id, bid, junk) VALUES (1, 1, repeat(pi()::text,20000));" |
| 49 | +); |
48 | 50 |
|
49 | 51 | $node_publisher->wait_for_catchup($appname);
|
50 | 52 |
|
@@ -127,7 +129,8 @@ BEGIN
|
127 | 129 |
|
128 | 130 | $result = $node_subscriber->safe_psql('postgres',
|
129 | 131 | "SELECT count(*), min(id), max(id) FROM tab_fk_ref;");
|
130 |
| -is($result, qq(2|1|2), 'check column trigger applied on even for other column'); |
| 132 | +is($result, qq(2|1|2), |
| 133 | + 'check column trigger applied even on update for other column'); |
131 | 134 |
|
132 | 135 | $node_subscriber->stop('fast');
|
133 | 136 | $node_publisher->stop('fast');
|
0 commit comments