forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7c4f524
committed
Logical replication support for initial data copy
Add functionality for a new subscription to copy the initial data in thetables and then sync with the ongoing apply process.For the copying, add a new internal COPY option to have the COPY sourcedata provided by a callback function. The initial data copy works onthe subscriber by receiving COPY data from the publisher and thenproviding it locally into a COPY that writes to the destination table.A WAL receiver can now execute full SQL commands. This is used here toobtain information about tables and publications.Several new options were added to CREATE and ALTER SUBSCRIPTION tocontrol whether and when initial table syncing happens.Change pg_dump option --no-create-subscription-slots to--no-subscription-connect and use the new CREATE SUBSCRIPTION... NOCONNECT option for that.Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>Tested-by: Erik Rijkers <er@xs4all.nl>1 parent707576b commit7c4f524
File tree
62 files changed
+2966
-341
lines changed- contrib/file_fdw
- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- parser
- postmaster
- replication
- libpqwalreceiver
- logical
- tcop
- utils
- adt
- cache
- misc
- bin/pg_dump
- t
- include
- catalog
- commands
- nodes
- parser
- replication
- utils
- test
- regress
- expected
- sql
- subscription/t
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
62 files changed
+2966
-341
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
662 | 662 |
| |
663 | 663 |
| |
664 | 664 |
| |
| 665 | + | |
665 | 666 |
| |
666 | 667 |
| |
667 | 668 |
| |
| |||
737 | 738 |
| |
738 | 739 |
| |
739 | 740 |
| |
| 741 | + | |
740 | 742 |
| |
741 | 743 |
| |
742 | 744 |
| |
| |||
1100 | 1102 |
| |
1101 | 1103 |
| |
1102 | 1104 |
| |
1103 |
| - | |
| 1105 | + | |
| 1106 | + | |
1104 | 1107 |
| |
1105 | 1108 |
| |
1106 | 1109 |
| |
|
Lines changed: 78 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
300 | 300 |
| |
301 | 301 |
| |
302 | 302 |
| |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
303 | 308 |
| |
304 | 309 |
| |
305 | 310 |
| |
| |||
6418 | 6423 |
| |
6419 | 6424 |
| |
6420 | 6425 |
| |
| 6426 | + | |
| 6427 | + | |
| 6428 | + | |
| 6429 | + | |
| 6430 | + | |
| 6431 | + | |
| 6432 | + | |
| 6433 | + | |
| 6434 | + | |
| 6435 | + | |
| 6436 | + | |
| 6437 | + | |
| 6438 | + | |
| 6439 | + | |
| 6440 | + | |
| 6441 | + | |
| 6442 | + | |
| 6443 | + | |
| 6444 | + | |
| 6445 | + | |
| 6446 | + | |
| 6447 | + | |
| 6448 | + | |
| 6449 | + | |
| 6450 | + | |
| 6451 | + | |
| 6452 | + | |
| 6453 | + | |
| 6454 | + | |
| 6455 | + | |
| 6456 | + | |
| 6457 | + | |
| 6458 | + | |
| 6459 | + | |
| 6460 | + | |
| 6461 | + | |
| 6462 | + | |
| 6463 | + | |
| 6464 | + | |
| 6465 | + | |
| 6466 | + | |
| 6467 | + | |
| 6468 | + | |
| 6469 | + | |
| 6470 | + | |
| 6471 | + | |
| 6472 | + | |
| 6473 | + | |
| 6474 | + | |
| 6475 | + | |
| 6476 | + | |
| 6477 | + | |
| 6478 | + | |
| 6479 | + | |
| 6480 | + | |
| 6481 | + | |
| 6482 | + | |
| 6483 | + | |
| 6484 | + | |
| 6485 | + | |
| 6486 | + | |
| 6487 | + | |
| 6488 | + | |
| 6489 | + | |
| 6490 | + | |
| 6491 | + | |
| 6492 | + | |
| 6493 | + | |
| 6494 | + | |
| 6495 | + | |
| 6496 | + | |
| 6497 | + | |
| 6498 | + | |
6421 | 6499 |
| |
6422 | 6500 |
| |
6423 | 6501 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3449 | 3449 |
| |
3450 | 3450 |
| |
3451 | 3451 |
| |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
3452 | 3477 |
| |
3453 | 3478 |
| |
3454 | 3479 |
| |
|
Lines changed: 40 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
28 |
| - | |
29 |
| - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 |
| |
31 | 33 |
| |
32 | 34 |
| |
| |||
159 | 161 |
| |
160 | 162 |
| |
161 | 163 |
| |
162 |
| - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
163 | 167 |
| |
164 | 168 |
| |
165 | 169 |
| |
| |||
264 | 268 |
| |
265 | 269 |
| |
266 | 270 |
| |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
267 | 287 |
| |
268 | 288 |
| |
269 |
| - | |
| 289 | + | |
270 | 290 |
| |
271 | 291 |
| |
272 | 292 |
| |
| |||
287 | 307 |
| |
288 | 308 |
| |
289 | 309 |
| |
290 |
| - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
291 | 313 |
| |
292 | 314 |
| |
293 | 315 |
| |
| |||
337 | 359 |
| |
338 | 360 |
| |
339 | 361 |
| |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
344 | 367 |
| |
345 | 368 |
| |
346 | 369 |
| |
347 | 370 |
| |
348 | 371 |
| |
349 | 372 |
| |
350 | 373 |
| |
351 |
| - | |
352 |
| - | |
353 |
| - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
354 | 377 |
| |
355 | 378 |
| |
356 | 379 |
| |
| |||
393 | 416 |
| |
394 | 417 |
| |
395 | 418 |
| |
396 |
| - | |
397 |
| - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
398 | 423 |
| |
399 | 424 |
| |
400 | 425 |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1863 | 1863 |
| |
1864 | 1864 |
| |
1865 | 1865 |
| |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
1866 | 1872 |
| |
1867 | 1873 |
| |
1868 | 1874 |
| |
| |||
1899 | 1905 |
| |
1900 | 1906 |
| |
1901 | 1907 |
| |
1902 |
| - | |
| 1908 | + | |
| 1909 | + | |
1903 | 1910 |
| |
1904 | 1911 |
| |
1905 | 1912 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1487 | 1487 |
| |
1488 | 1488 |
| |
1489 | 1489 |
| |
1490 |
| - | |
| 1490 | + | |
1491 | 1491 |
| |
1492 | 1492 |
| |
1493 | 1493 |
| |
| |||
1542 | 1542 |
| |
1543 | 1543 |
| |
1544 | 1544 |
| |
| 1545 | + | |
1545 | 1546 |
| |
1546 | 1547 |
| |
1547 | 1548 |
| |
1548 | 1549 |
| |
1549 | 1550 |
| |
1550 |
| - | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
1551 | 1556 |
| |
1552 | 1557 |
| |
1553 | 1558 |
| |
|
Lines changed: 45 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 |
| |
30 | 37 |
| |
31 | 38 |
| |
32 |
| - | |
33 | 39 |
| |
34 | 40 |
| |
35 | 41 |
| |
| |||
65 | 71 |
| |
66 | 72 |
| |
67 | 73 |
| |
68 |
| - | |
69 | 74 |
| |
70 | 75 |
| |
71 | 76 |
| |
| |||
76 | 81 |
| |
77 | 82 |
| |
78 | 83 |
| |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
79 | 118 |
| |
80 | 119 |
| |
81 | 120 |
| |
| |||
95 | 134 |
| |
96 | 135 |
| |
97 | 136 |
| |
| 137 | + | |
98 | 138 |
| |
99 | 139 |
| |
100 | 140 |
| |
|
0 commit comments
Comments
(0)