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

Amit Kapila
Allow users to skip logical replication of data having origin.
This patch adds a new SUBSCRIPTION parameter "origin". It specifieswhether the subscription will request the publisher to only send changesthat don't have an origin or send changes regardless of origin. Setting itto "none" means that the subscription will request the publisher to onlysend changes that have no origin associated. Setting it to "any" meansthat the publisher sends changes regardless of their origin. The defaultis "any".Usage:CREATE SUBSCRIPTION sub1 CONNECTION 'dbname=postgres port=9999'PUBLICATION pub1 WITH (origin = none);This can be used to avoid loops (infinite replication of the same data)among replication nodes.This feature allows filtering only the replication data originating fromWAL but for initial sync (initial copy of table data) we don't have such afacility as we can only distinguish the data based on origin from WAL. Asa follow-up patch, we are planning to forbid the initial sync if theorigin is specified as none and we notice that the publication tables werealso replicated from other publishers to avoid duplicate data or loops.We forbid to allow creating origin with names 'none' and 'any' to avoidconfusion with the same name options.Author: Vignesh C, Amit KapilaReviewed-By: Peter Smith, Amit Kapila, Dilip Kumar, Shi yu, Ashutosh Bapat, Hayato KurodaDiscussion:https://postgr.es/m/CALDaNm0gwjY_4HFxvvty01BOT01q_fJLKQ3pWP9=9orqubhjcQ@mail.gmail.com1 parentf2d0c7f commit3662839
File tree
24 files changed
+463
-78
lines changed- contrib/test_decoding
- expected
- sql
- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- replication
- libpqwalreceiver
- logical
- pgoutput
- bin
- pg_dump
- t
- psql
- include
- catalog
- replication
- test
- regress
- expected
- sql
- subscription/t
24 files changed
+463
-78
lines changedLines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 |
| |
60 | 70 |
| |
61 | 71 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 |
| |
35 | 40 |
| |
36 | 41 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7943 | 7943 |
| |
7944 | 7944 |
| |
7945 | 7945 |
| |
| 7946 | + | |
| 7947 | + | |
| 7948 | + | |
| 7949 | + | |
| 7950 | + | |
| 7951 | + | |
| 7952 | + | |
| 7953 | + | |
| 7954 | + | |
| 7955 | + | |
| 7956 | + | |
| 7957 | + | |
| 7958 | + | |
| 7959 | + | |
7946 | 7960 |
| |
7947 | 7961 |
| |
7948 | 7962 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
210 |
| - | |
211 |
| - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
212 | 213 |
| |
213 | 214 |
| |
214 | 215 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
302 | 302 |
| |
303 | 303 |
| |
304 | 304 |
| |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
305 | 320 |
| |
306 | 321 |
| |
307 | 322 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
109 | 117 |
| |
110 | 118 |
| |
111 | 119 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1298 | 1298 |
| |
1299 | 1299 |
| |
1300 | 1300 |
| |
1301 |
| - | |
1302 |
| - | |
| 1301 | + | |
| 1302 | + | |
1303 | 1303 |
| |
1304 | 1304 |
| |
1305 | 1305 |
| |
|
Lines changed: 40 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| 67 | + | |
67 | 68 |
| |
68 | 69 |
| |
69 | 70 |
| |
| |||
86 | 87 |
| |
87 | 88 |
| |
88 | 89 |
| |
| 90 | + | |
89 | 91 |
| |
90 | 92 |
| |
91 | 93 |
| |
| |||
118 | 120 |
| |
119 | 121 |
| |
120 | 122 |
| |
121 |
| - | |
| 123 | + | |
122 | 124 |
| |
123 | 125 |
| |
124 | 126 |
| |
| |||
137 | 139 |
| |
138 | 140 |
| |
139 | 141 |
| |
| 142 | + | |
| 143 | + | |
140 | 144 |
| |
141 | 145 |
| |
142 | 146 |
| |
| |||
265 | 269 |
| |
266 | 270 |
| |
267 | 271 |
| |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
268 | 295 |
| |
269 | 296 |
| |
270 | 297 |
| |
| |||
530 | 557 |
| |
531 | 558 |
| |
532 | 559 |
| |
533 |
| - | |
| 560 | + | |
534 | 561 |
| |
535 | 562 |
| |
536 | 563 |
| |
| |||
617 | 644 |
| |
618 | 645 |
| |
619 | 646 |
| |
| 647 | + | |
| 648 | + | |
620 | 649 |
| |
621 | 650 |
| |
622 | 651 |
| |
| |||
1014 | 1043 |
| |
1015 | 1044 |
| |
1016 | 1045 |
| |
1017 |
| - | |
| 1046 | + | |
| 1047 | + | |
1018 | 1048 |
| |
1019 | 1049 |
| |
1020 | 1050 |
| |
| |||
1071 | 1101 |
| |
1072 | 1102 |
| |
1073 | 1103 |
| |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1074 | 1111 |
| |
1075 | 1112 |
| |
1076 | 1113 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
451 | 451 |
| |
452 | 452 |
| |
453 | 453 |
| |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
454 | 459 |
| |
455 | 460 |
| |
456 | 461 |
| |
|
Lines changed: 19 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| 80 | + | |
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
| |||
195 | 196 |
| |
196 | 197 |
| |
197 | 198 |
| |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
198 | 210 |
| |
199 | 211 |
| |
200 | 212 |
| |
| |||
1244 | 1256 |
| |
1245 | 1257 |
| |
1246 | 1258 |
| |
1247 |
| - | |
1248 |
| - | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
1249 | 1264 |
| |
1250 | 1265 |
| |
1251 | 1266 |
| |
1252 | 1267 |
| |
1253 |
| - | |
| 1268 | + | |
| 1269 | + | |
1254 | 1270 |
| |
1255 | 1271 |
| |
1256 | 1272 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3077 | 3077 |
| |
3078 | 3078 |
| |
3079 | 3079 |
| |
| 3080 | + | |
3080 | 3081 |
| |
3081 | 3082 |
| |
3082 | 3083 |
| |
| |||
3758 | 3759 |
| |
3759 | 3760 |
| |
3760 | 3761 |
| |
| 3762 | + | |
3761 | 3763 |
| |
3762 | 3764 |
| |
3763 | 3765 |
| |
|
Lines changed: 26 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
| 83 | + | |
82 | 84 |
| |
83 | 85 |
| |
84 | 86 |
| |
| |||
285 | 287 |
| |
286 | 288 |
| |
287 | 289 |
| |
| 290 | + | |
288 | 291 |
| |
289 | 292 |
| |
290 | 293 |
| |
| |||
378 | 381 |
| |
379 | 382 |
| |
380 | 383 |
| |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
381 | 402 |
| |
382 | 403 |
| |
383 | 404 |
| |
| |||
1696 | 1717 |
| |
1697 | 1718 |
| |
1698 | 1719 |
| |
1699 |
| - | |
| 1720 | + | |
| 1721 | + | |
1700 | 1722 |
| |
1701 | 1723 |
| |
1702 | 1724 |
| |
1703 | 1725 |
| |
1704 | 1726 |
| |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
1705 | 1730 |
| |
1706 | 1731 |
| |
1707 | 1732 |
| |
|
0 commit comments
Comments
(0)