forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1f8a332
committed
Avoid having two PKs in a partition
If a table containing a primary key is attach as partition to apartitioned table which has a primary key with a different definition,we would happily create a second one in the new partition. Oops. Itturns out that this is because an error check in DefineIndex is executedonly if you tell it that it's being run by ALTER TABLE, and the originalcode here wasn't. Change it so that it does.Added a couple of test cases for this, also. A previously working teststarted to fail in a different way than before patch because the newcheck is called earlier; change the PK to plain UNIQUE so that the newbehavior isn't invoked, so that the test continues to verify what wewant it to verify.Reported by: Noriyoshi ShinodaDiscussion:https://postgr.es/m/DF4PR8401MB102060EC2615EC9227CC73F7EEDF0@DF4PR8401MB1020.NAMPRD84.PROD.OUTLOOK.COM1 parent63cbee6 commit1f8a332
File tree
4 files changed
+42
-10
lines changed- src
- backend/commands
- test/regress
- expected
- sql
4 files changed
+42
-10
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
973 | 973 |
| |
974 | 974 |
| |
975 | 975 |
| |
976 |
| - | |
| 976 | + | |
977 | 977 |
| |
978 | 978 |
| |
979 | 979 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14256 | 14256 |
| |
14257 | 14257 |
| |
14258 | 14258 |
| |
14259 |
| - | |
| 14259 | + | |
14260 | 14260 |
| |
14261 | 14261 |
| |
14262 | 14262 |
| |
|
Lines changed: 21 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
878 | 878 |
| |
879 | 879 |
| |
880 | 880 |
| |
881 |
| - | |
| 881 | + | |
882 | 882 |
| |
883 | 883 |
| |
884 | 884 |
| |
885 | 885 |
| |
886 | 886 |
| |
887 | 887 |
| |
888 | 888 |
| |
889 |
| - | |
890 |
| - | |
| 889 | + | |
| 890 | + | |
891 | 891 |
| |
892 | 892 |
| |
893 |
| - | |
894 |
| - | |
| 893 | + | |
| 894 | + | |
895 | 895 |
| |
896 | 896 |
| |
897 | 897 |
| |
| |||
952 | 952 |
| |
953 | 953 |
| |
954 | 954 |
| |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
955 | 971 |
| |
956 | 972 |
| |
957 | 973 |
| |
|
Lines changed: 19 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
444 | 444 |
| |
445 | 445 |
| |
446 | 446 |
| |
447 |
| - | |
| 447 | + | |
448 | 448 |
| |
449 | 449 |
| |
450 | 450 |
| |
451 | 451 |
| |
452 | 452 |
| |
453 | 453 |
| |
454 |
| - | |
455 |
| - | |
| 454 | + | |
| 455 | + | |
456 | 456 |
| |
457 | 457 |
| |
458 | 458 |
| |
| |||
494 | 494 |
| |
495 | 495 |
| |
496 | 496 |
| |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
497 | 513 |
| |
498 | 514 |
| |
499 | 515 |
| |
|
0 commit comments
Comments
(0)