|
57 | 57 | "CREATE INDEX idx_no_replidentity_index ON tab_no_replidentity_index(c1)" |
58 | 58 | ); |
59 | 59 |
|
| 60 | +# Replicate the changes without columns |
| 61 | +$node_publisher->safe_psql('postgres', "CREATE TABLE tab_no_col()"); |
| 62 | +$node_publisher->safe_psql('postgres', |
| 63 | + "INSERT INTO tab_no_col default VALUES"); |
| 64 | + |
60 | 65 | # Setup structure on subscriber |
61 | 66 | $node_subscriber->safe_psql('postgres', "CREATE TABLE tab_notrep (a int)"); |
62 | 67 | $node_subscriber->safe_psql('postgres', "CREATE TABLE tab_ins (a int)"); |
|
87 | 92 | "CREATE INDEX idx_no_replidentity_index ON tab_no_replidentity_index(c1)" |
88 | 93 | ); |
89 | 94 |
|
| 95 | +# replication of the table without columns |
| 96 | +$node_subscriber->safe_psql('postgres', "CREATE TABLE tab_no_col()"); |
| 97 | + |
90 | 98 | # Setup logical replication |
91 | 99 | my $publisher_connstr = $node_publisher->connstr . ' dbname=postgres'; |
92 | 100 | $node_publisher->safe_psql('postgres', "CREATE PUBLICATION tap_pub"); |
93 | 101 | $node_publisher->safe_psql('postgres', |
94 | 102 | "CREATE PUBLICATION tap_pub_ins_only WITH (publish = insert)"); |
95 | 103 | $node_publisher->safe_psql('postgres', |
96 | | - "ALTER PUBLICATION tap_pub ADD TABLE tab_rep, tab_full, tab_full2, tab_mixed, tab_include, tab_nothing, tab_full_pk, tab_no_replidentity_index" |
| 104 | + "ALTER PUBLICATION tap_pub ADD TABLE tab_rep, tab_full, tab_full2, tab_mixed, tab_include, tab_nothing, tab_full_pk, tab_no_replidentity_index, tab_no_col" |
97 | 105 | ); |
98 | 106 | $node_publisher->safe_psql('postgres', |
99 | 107 | "ALTER PUBLICATION tap_pub_ins_only ADD TABLE tab_ins"); |
|
141 | 149 | $node_publisher->safe_psql('postgres', |
142 | 150 | "INSERT INTO tab_no_replidentity_index VALUES(1)"); |
143 | 151 |
|
| 152 | +$node_publisher->safe_psql('postgres', |
| 153 | + "INSERT INTO tab_no_col default VALUES"); |
| 154 | + |
144 | 155 | $node_publisher->wait_for_catchup('tap_sub'); |
145 | 156 |
|
146 | 157 | $result = $node_subscriber->safe_psql('postgres', |
|
169 | 180 | 1, |
170 | 181 | "value replicated to subscriber without replica identity index"); |
171 | 182 |
|
| 183 | +$result = |
| 184 | + $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM tab_no_col"); |
| 185 | +is($result, qq(2), 'check replicated changes for table having no columns'); |
| 186 | + |
172 | 187 | # insert some duplicate rows |
173 | 188 | $node_publisher->safe_psql('postgres', |
174 | 189 | "INSERT INTO tab_full SELECT generate_series(1,10)"); |
|
0 commit comments