Skip to content

Commit c7e9bc8

Browse files
Peter SmithCommitfest Bot
authored andcommitted
Add missing test case
1 parent 7fe312f commit c7e9bc8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/subscription/t/008_diff_schema.pl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@
118118
qq(1|1|1),
119119
'check replicated inserts on subscriber');
120120

121+
# Test if the expected error is reported when the subscriber table is missing
122+
# columns which were specified on the publisher table.
123+
124+
$node_publisher->safe_psql('postgres', "CREATE TABLE test_tab3 (a int, b int, c int)");
125+
$node_subscriber->safe_psql('postgres', "CREATE TABLE test_tab3 (a int)");
126+
127+
my $offset = -s $node_subscriber->logfile;
128+
129+
$node_subscriber->safe_psql('postgres',
130+
"ALTER SUBSCRIPTION tap_sub REFRESH PUBLICATION");
131+
132+
$node_subscriber->wait_for_log(
133+
qr/ERROR: ( [A-Z0-9]+:)? logical replication target relation "public.test_tab3" is missing replicated columns: "b", "c"/,
134+
$offset);
121135

122136
$node_subscriber->stop;
123137
$node_publisher->stop;

0 commit comments

Comments
 (0)