forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit923def9
committed
Allow specifying column lists for logical replication
This allows specifying an optional column list when adding a table tological replication. The column list may be specified after the tablename, enclosed in parentheses. Columns not included in this list are notsent to the subscriber, allowing the schema on the subscriber to be asubset of the publisher schema.For UPDATE/DELETE publications, the column list needs to cover allREPLICA IDENTITY columns. For INSERT publications, the column list isarbitrary and may omit some REPLICA IDENTITY columns. Furthermore, ifthe table uses REPLICA IDENTITY FULL, column list is not allowed.The column list can contain only simple column references. Complexexpressions, function calls etc. are not allowed. This restriction couldbe relaxed in the future.During the initial table synchronization, only columns included in thecolumn list are copied to the subscriber. If the subscription hasseveral publications, containing the same table with different columnlists, columns specified in any of the lists will be copied.This means all columns are replicated if the table has no column listat all (which is treated as column list with all columns), or when ofthe publications is defined as FOR ALL TABLES (possibly IN SCHEMA thatmatches the schema of the table).For partitioned tables, publish_via_partition_root determines whetherthe column list for the root or the leaf relation will be used. If theparameter is 'false' (the default), the list defined for the leafrelation is used. Otherwise, the column list for the root partitionwill be used.Psql commands \dRp+ and \d <table-name> now display any column lists.Author: Tomas Vondra, Alvaro Herrera, Rahila SyedReviewed-by: Peter Eisentraut, Alvaro Herrera, Vignesh C, Ibrar Ahmed,Amit Kapila, Hou zj, Peter Smith, Wang wei, Tang, Shi yuDiscussion:https://postgr.es/m/CAH2L28vddB_NFdRVpuyRBJEBWjz4BSyTB=_ektNRH8NJ1jf95g@mail.gmail.com1 parent05843b1 commit923def9
File tree
26 files changed
+2833
-92
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- executor
- nodes
- parser
- replication
- logical
- pgoutput
- utils/cache
- bin
- pg_dump
- t
- psql
- include
- catalog
- commands
- nodes
- replication
- test
- regress
- expected
- sql
- subscription/t
26 files changed
+2833
-92
lines changedLines changed: 14 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4410 | 4410 |
| |
4411 | 4411 |
| |
4412 | 4412 |
| |
4413 |
| - | |
| 4413 | + | |
4414 | 4414 |
| |
4415 | 4415 |
| |
4416 | 4416 |
| |
| |||
6291 | 6291 |
| |
6292 | 6292 |
| |
6293 | 6293 |
| |
| 6294 | + | |
| 6295 | + | |
| 6296 | + | |
| 6297 | + | |
| 6298 | + | |
| 6299 | + | |
| 6300 | + | |
| 6301 | + | |
| 6302 | + | |
| 6303 | + | |
| 6304 | + | |
| 6305 | + | |
| 6306 | + | |
6294 | 6307 |
| |
6295 | 6308 |
| |
6296 | 6309 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7016 | 7016 |
| |
7017 | 7017 |
| |
7018 | 7018 |
| |
7019 |
| - | |
| 7019 | + | |
| 7020 | + | |
7020 | 7021 |
| |
7021 | 7022 |
| |
7022 | 7023 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 |
| - | |
| 33 | + | |
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
117 | 125 |
| |
118 | 126 |
| |
119 | 127 |
| |
| |||
185 | 193 |
| |
186 | 194 |
| |
187 | 195 |
| |
188 |
| - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
189 | 203 |
| |
190 | 204 |
| |
191 | 205 |
| |
|
Lines changed: 16 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
96 | 103 |
| |
97 | 104 |
| |
98 | 105 |
| |
| |||
348 | 355 |
| |
349 | 356 |
| |
350 | 357 |
| |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
351 | 366 |
| |
352 | 367 |
| |
353 | 368 |
| |
|
Lines changed: 145 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 |
| |
49 | 52 |
| |
50 | 53 |
| |
| |||
395 | 398 |
| |
396 | 399 |
| |
397 | 400 |
| |
| 401 | + | |
| 402 | + | |
398 | 403 |
| |
399 | 404 |
| |
400 | 405 |
| |
| |||
422 | 427 |
| |
423 | 428 |
| |
424 | 429 |
| |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
425 | 438 |
| |
426 | 439 |
| |
427 | 440 |
| |
| |||
440 | 453 |
| |
441 | 454 |
| |
442 | 455 |
| |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
443 | 462 |
| |
444 | 463 |
| |
445 | 464 |
| |
| |||
463 | 482 |
| |
464 | 483 |
| |
465 | 484 |
| |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
466 | 492 |
| |
467 | 493 |
| |
468 | 494 |
| |
| |||
482 | 508 |
| |
483 | 509 |
| |
484 | 510 |
| |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
485 | 630 |
| |
486 | 631 |
| |
487 | 632 |
| |
|
0 commit comments
Comments
(0)