Skip to content

Commit 2650872

Browse files
author
Commitfest Bot
committed
[CF 5190] v2 - CREATE SUBSCRIPTION - add missing test case
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5190 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAHut+Puxkif7sg-Jah9Qw8RNKL3zb7v_gqMmOudvo57PG_hUTQ@mail.gmail.com Author(s): Peter Smith
2 parents 7fe312f + c7e9bc8 commit 2650872

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)