forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit26b3455

Amit Kapila
Fix partition table's REPLICA IDENTITY checking on the subscriber.
In logical replication, we will check if the target table on thesubscriber is updatable by comparing the replica identity of the table onthe publisher with the table on the subscriber. When the target table is apartitioned table, we only check its replica identity but not for thepartition tables. This leads to assertion failure while applying changesfor update/delete as we expect those to succeed only when thecorresponding partition table has a primary key or has a replicaidentity defined.Fix it by checking the replica identity of the partition table whileapplying changes.Reported-by: Shi YuAuthor: Shi Yu, Hou ZhijieReviewed-by: Amit Langote, Amit KapilaBackpatch-through: 13, where it was introducedDiscussion:https://postgr.es/m/OSZPR01MB6310F46CD425A967E4AEF736FDA49@OSZPR01MB6310.jpnprd01.prod.outlook.com1 parent2253f5b commit26b3455
File tree
3 files changed
+101
-55
lines changed- src
- backend/replication/logical
- test/subscription/t
3 files changed
+101
-55
lines changedLines changed: 66 additions & 49 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
252 | 313 |
| |
253 | 314 |
| |
254 | 315 |
| |
| |||
307 | 368 |
| |
308 | 369 |
| |
309 | 370 |
| |
310 |
| - | |
311 | 371 |
| |
312 | 372 |
| |
313 | 373 |
| |
| |||
366 | 426 |
| |
367 | 427 |
| |
368 | 428 |
| |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
| 429 | + | |
| 430 | + | |
378 | 431 |
| |
379 |
| - | |
380 |
| - | |
381 |
| - | |
382 |
| - | |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 |
| - | |
387 |
| - | |
388 |
| - | |
389 |
| - | |
390 |
| - | |
391 |
| - | |
392 |
| - | |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
403 |
| - | |
404 |
| - | |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 |
| - | |
413 |
| - | |
414 |
| - | |
415 |
| - | |
416 |
| - | |
| 432 | + | |
417 | 433 |
| |
418 | 434 |
| |
419 | 435 |
| |
| |||
651 | 667 |
| |
652 | 668 |
| |
653 | 669 |
| |
654 |
| - | |
| 670 | + | |
| 671 | + | |
655 | 672 |
| |
656 | 673 |
| |
657 | 674 |
| |
|
Lines changed: 21 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1738 | 1738 |
| |
1739 | 1739 |
| |
1740 | 1740 |
| |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
1741 | 1748 |
| |
1742 | 1749 |
| |
1743 | 1750 |
| |
| |||
2121 | 2128 |
| |
2122 | 2129 |
| |
2123 | 2130 |
| |
| 2131 | + | |
| 2132 | + | |
2124 | 2133 |
| |
2125 | 2134 |
| |
2126 | 2135 |
| |
| |||
2152 | 2161 |
| |
2153 | 2162 |
| |
2154 | 2163 |
| |
2155 |
| - | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
2156 | 2167 |
| |
| 2168 | + | |
2157 | 2169 |
| |
2158 | 2170 |
| |
2159 | 2171 |
| |
2160 | 2172 |
| |
2161 | 2173 |
| |
2162 | 2174 |
| |
2163 | 2175 |
| |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
2164 | 2184 |
| |
2165 | 2185 |
| |
2166 | 2186 |
| |
| |||
2182 | 2202 |
| |
2183 | 2203 |
| |
2184 | 2204 |
| |
2185 |
| - | |
2186 |
| - | |
2187 | 2205 |
| |
2188 | 2206 |
| |
2189 | 2207 |
| |
2190 | 2208 |
| |
2191 |
| - | |
2192 |
| - | |
2193 |
| - | |
2194 | 2209 |
| |
2195 | 2210 |
| |
2196 | 2211 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
868 | 868 |
| |
869 | 869 |
| |
870 | 870 |
| |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
871 | 885 |
|
0 commit comments
Comments
(0)