Commit 885742b
committed
Change the way ATExecMergePartitions() handles the name collision
The name collision happens when the name of the new partition is the same as
the name of one of the merging partitions. Currently, ATExecMergePartitions()
first gives the new partition a temporary name and then renames it when old
partitions are deleted. That negatively influences the naming of related
objects like indexes and constrains, which could inherit a temporary name.
This commit changes the implementation in the following way. A merging
partition gets renamed first, then the new partition is created with the
right name immediately. This resolves the issue of the naming of related
objects.
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/edfbd846-dcc1-42d1-ac26-715691b687d3%40postgrespro.ru
Author: Dmitry Koval, Alexander Korotkov
Reviewed-by: Robert Haas, Justin Pryzby, Pavel Borisov1 parent 5bcbe98 commit 885742b
File tree
3 files changed
+73
-33
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+73
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21503 | 21503 | | |
21504 | 21504 | | |
21505 | 21505 | | |
21506 | | - | |
21507 | | - | |
21508 | | - | |
21509 | 21506 | | |
21510 | 21507 | | |
21511 | 21508 | | |
| |||
21527 | 21524 | | |
21528 | 21525 | | |
21529 | 21526 | | |
| 21527 | + | |
21530 | 21528 | | |
21531 | | - | |
| 21529 | + | |
| 21530 | + | |
| 21531 | + | |
| 21532 | + | |
| 21533 | + | |
| 21534 | + | |
| 21535 | + | |
| 21536 | + | |
| 21537 | + | |
| 21538 | + | |
| 21539 | + | |
| 21540 | + | |
| 21541 | + | |
| 21542 | + | |
| 21543 | + | |
| 21544 | + | |
| 21545 | + | |
| 21546 | + | |
| 21547 | + | |
| 21548 | + | |
21532 | 21549 | | |
21533 | 21550 | | |
21534 | 21551 | | |
| |||
21548 | 21565 | | |
21549 | 21566 | | |
21550 | 21567 | | |
21551 | | - | |
21552 | | - | |
21553 | | - | |
21554 | | - | |
21555 | | - | |
21556 | | - | |
21557 | | - | |
21558 | | - | |
21559 | | - | |
| 21568 | + | |
21560 | 21569 | | |
21561 | 21570 | | |
21562 | 21571 | | |
| |||
21567 | 21576 | | |
21568 | 21577 | | |
21569 | 21578 | | |
21570 | | - | |
| 21579 | + | |
21571 | 21580 | | |
21572 | 21581 | | |
21573 | 21582 | | |
21574 | 21583 | | |
21575 | | - | |
21576 | | - | |
21577 | | - | |
21578 | | - | |
21579 | | - | |
21580 | | - | |
21581 | | - | |
| 21584 | + | |
21582 | 21585 | | |
21583 | 21586 | | |
21584 | 21587 | | |
| |||
21596 | 21599 | | |
21597 | 21600 | | |
21598 | 21601 | | |
21599 | | - | |
21600 | | - | |
21601 | | - | |
21602 | | - | |
21603 | | - | |
21604 | | - | |
21605 | | - | |
21606 | | - | |
21607 | | - | |
21608 | | - | |
21609 | | - | |
21610 | | - | |
| 21602 | + | |
| 21603 | + | |
| 21604 | + | |
| 21605 | + | |
| 21606 | + | |
| 21607 | + | |
21611 | 21608 | | |
21612 | 21609 | | |
21613 | 21610 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
749 | 774 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
447 | 465 | | |
448 | 466 | | |
0 commit comments