forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5b02d68
committed
Fix ALTER TABLE's scheduling rules for AT_AddConstraint subcommands.
Commit1281a5c rearranged the logic in this area rather drastically,and it broke the case of adding a foreign key constraint in the sameALTER that adds the pkey or unique constraint it depends on. Whileself-referential fkeys are surely a pretty niche case, this used towork so we shouldn't break it.To fix, reorganize the scheduling rules in ATParseTransformCmd sothat a transformed AT_AddConstraint subcommand will be delayed intoa later pass in all cases, not only when it's been spit out as aside-effect of parsing some other command type.Also tweak the logic so that we won't run ATParseTransformCmd twicewhile doing this. It seems to work even without that, but it'ssurely wasting cycles to do so.Per bug #16589 from Jeremy Evans. Back-patch to v13 where the newcode was introduced.Discussion:https://postgr.es/m/16589-31c8d981ca503896@postgresql.org1 parentc3a2886 commit5b02d68
File tree
3 files changed
+135
-66
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+135
-66
lines changedLines changed: 85 additions & 66 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4513 | 4513 |
| |
4514 | 4514 |
| |
4515 | 4515 |
| |
4516 |
| - | |
4517 |
| - | |
4518 |
| - | |
| 4516 | + | |
| 4517 | + | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
4519 | 4522 |
| |
4520 | 4523 |
| |
4521 | 4524 |
| |
4522 | 4525 |
| |
4523 | 4526 |
| |
4524 | 4527 |
| |
4525 | 4528 |
| |
4526 |
| - | |
4527 |
| - | |
4528 |
| - | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
4529 | 4535 |
| |
4530 | 4536 |
| |
4531 | 4537 |
| |
| |||
4787 | 4793 |
| |
4788 | 4794 |
| |
4789 | 4795 |
| |
| 4796 | + | |
| 4797 | + | |
| 4798 | + | |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
| 4803 | + | |
| 4804 | + | |
| 4805 | + | |
| 4806 | + | |
| 4807 | + | |
| 4808 | + | |
| 4809 | + | |
| 4810 | + | |
| 4811 | + | |
| 4812 | + | |
| 4813 | + | |
| 4814 | + | |
| 4815 | + | |
| 4816 | + | |
| 4817 | + | |
| 4818 | + | |
| 4819 | + | |
| 4820 | + | |
| 4821 | + | |
| 4822 | + | |
| 4823 | + | |
| 4824 | + | |
| 4825 | + | |
| 4826 | + | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
| 4834 | + | |
| 4835 | + | |
| 4836 | + | |
| 4837 | + | |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
4790 | 4852 |
| |
4791 |
| - | |
4792 |
| - | |
4793 |
| - | |
4794 |
| - | |
| 4853 | + | |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
| 4859 | + | |
4795 | 4860 |
| |
4796 |
| - | |
4797 |
| - | |
4798 |
| - | |
| 4861 | + | |
| 4862 | + | |
4799 | 4863 |
| |
4800 | 4864 |
| |
4801 | 4865 |
| |
4802 |
| - | |
4803 |
| - | |
4804 | 4866 |
| |
4805 |
| - | |
4806 |
| - | |
4807 |
| - | |
| 4867 | + | |
| 4868 | + | |
4808 | 4869 |
| |
4809 |
| - | |
| 4870 | + | |
4810 | 4871 |
| |
4811 |
| - | |
4812 |
| - | |
4813 |
| - | |
4814 |
| - | |
4815 |
| - | |
4816 |
| - | |
4817 |
| - | |
4818 |
| - | |
4819 |
| - | |
4820 |
| - | |
4821 |
| - | |
4822 |
| - | |
4823 |
| - | |
4824 |
| - | |
4825 |
| - | |
4826 |
| - | |
4827 |
| - | |
4828 |
| - | |
4829 |
| - | |
4830 |
| - | |
4831 |
| - | |
4832 |
| - | |
4833 |
| - | |
4834 |
| - | |
4835 |
| - | |
4836 |
| - | |
4837 |
| - | |
4838 |
| - | |
4839 |
| - | |
4840 |
| - | |
4841 |
| - | |
4842 |
| - | |
4843 |
| - | |
4844 |
| - | |
4845 |
| - | |
4846 |
| - | |
4847 |
| - | |
4848 |
| - | |
4849 |
| - | |
4850 |
| - | |
4851 |
| - | |
4852 |
| - | |
4853 |
| - | |
| 4872 | + | |
| 4873 | + | |
4854 | 4874 |
| |
4855 |
| - | |
4856 |
| - | |
4857 |
| - | |
4858 |
| - | |
| 4875 | + | |
| 4876 | + | |
| 4877 | + | |
4859 | 4878 |
| |
4860 | 4879 |
| |
4861 | 4880 |
| |
|
Lines changed: 36 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3678 | 3678 |
| |
3679 | 3679 |
| |
3680 | 3680 |
| |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
3681 | 3717 |
| |
3682 | 3718 |
| |
3683 | 3719 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2252 | 2252 |
| |
2253 | 2253 |
| |
2254 | 2254 |
| |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
2255 | 2269 |
| |
2256 | 2270 |
| |
2257 | 2271 |
| |
|
0 commit comments
Comments
(0)