forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit270af6f
committed
Admit deferrable PKs into rd_pkindex, but flag them as such
... and in particular don't return them as replica identity.The motivation for this change is letting the primary keys be seen bycode that derives NOT NULL constraints from them, when creatinginheritance children; before this change, if you had a deferrable PK,pg_dump would not recreate the attnotnull marking properly, because thecolumn would not be considered as having anything to back said markingafter dropping the throwaway NOT NULL constraint.The reason we don't want these PKs as replica identities is thatreplication can corrupt data, if the uniqueness constraint istransiently broken.Reported-by: Amul Sul <sulamul@gmail.com>Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>Discussion:https://postgr.es/m/CAAJ_b94QonkgsbDXofakHDnORQNgafd1y3Oa5QXfpQNJyXyQ7A@mail.gmail.com1 parent4c1973f commit270af6f
File tree
9 files changed
+170
-11
lines changed- src
- backend
- replication/logical
- utils/cache
- include/utils
- test/regress
- expected
- sql
9 files changed
+170
-11
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
843 | 843 |
| |
844 | 844 |
| |
845 | 845 |
| |
846 |
| - | |
847 |
| - | |
848 |
| - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
849 | 849 |
| |
850 | 850 |
| |
851 | 851 |
| |
|
Lines changed: 20 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4761 | 4761 |
| |
4762 | 4762 |
| |
4763 | 4763 |
| |
| 4764 | + | |
4764 | 4765 |
| |
4765 | 4766 |
| |
4766 | 4767 |
| |
| |||
4802 | 4803 |
| |
4803 | 4804 |
| |
4804 | 4805 |
| |
4805 |
| - | |
4806 |
| - | |
4807 |
| - | |
| 4806 | + | |
| 4807 | + | |
| 4808 | + | |
| 4809 | + | |
4808 | 4810 |
| |
4809 | 4811 |
| |
4810 |
| - | |
4811 | 4812 |
| |
4812 | 4813 |
| |
4813 | 4814 |
| |
| |||
4832 | 4833 |
| |
4833 | 4834 |
| |
4834 | 4835 |
| |
| 4836 | + | |
4835 | 4837 |
| |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
4836 | 4843 |
| |
4837 | 4844 |
| |
4838 | 4845 |
| |
| |||
4854 | 4861 |
| |
4855 | 4862 |
| |
4856 | 4863 |
| |
4857 |
| - | |
| 4864 | + | |
| 4865 | + | |
4858 | 4866 |
| |
4859 | 4867 |
| |
4860 | 4868 |
| |
| |||
4957 | 4965 |
| |
4958 | 4966 |
| |
4959 | 4967 |
| |
4960 |
| - | |
| 4968 | + | |
| 4969 | + | |
4961 | 4970 |
| |
4962 | 4971 |
| |
4963 | 4972 |
| |
| |||
4972 | 4981 |
| |
4973 | 4982 |
| |
4974 | 4983 |
| |
4975 |
| - | |
| 4984 | + | |
4976 | 4985 |
| |
4977 | 4986 |
| |
4978 | 4987 |
| |
| |||
5190 | 5199 |
| |
5191 | 5200 |
| |
5192 | 5201 |
| |
| 5202 | + | |
5193 | 5203 |
| |
5194 | 5204 |
| |
5195 | 5205 |
| |
| |||
5198 | 5208 |
| |
5199 | 5209 |
| |
5200 | 5210 |
| |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
5201 | 5214 |
| |
5202 | 5215 |
| |
5203 | 5216 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
150 | 150 |
| |
151 | 151 |
| |
152 | 152 |
| |
153 |
| - | |
| 153 | + | |
| 154 | + | |
154 | 155 |
| |
155 | 156 |
| |
156 | 157 |
| |
|
Lines changed: 92 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1017 | 1017 |
| |
1018 | 1018 |
| |
1019 | 1019 |
| |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1020 | 1112 |
| |
1021 | 1113 |
| |
1022 | 1114 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
732 | 732 |
| |
733 | 733 |
| |
734 | 734 |
| |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
735 | 745 |
| |
736 | 746 |
| |
737 | 747 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
| |||
57 | 58 |
| |
58 | 59 |
| |
59 | 60 |
| |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 |
| |
61 | 65 |
| |
62 | 66 |
| |
| |||
292 | 296 |
| |
293 | 297 |
| |
294 | 298 |
| |
| 299 | + |
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
668 | 668 |
| |
669 | 669 |
| |
670 | 670 |
| |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
671 | 696 |
| |
672 | 697 |
| |
673 | 698 |
| |
|
Lines changed: 9 additions & 0 deletions
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 | + | |
447 | 456 |
| |
448 | 457 |
| |
449 | 458 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| 11 | + | |
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
| |||
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
| 44 | + | |
| 45 | + | |
43 | 46 |
| |
44 | 47 |
| |
45 | 48 |
| |
| |||
137 | 140 |
| |
138 | 141 |
| |
139 | 142 |
| |
| 143 | + |
0 commit comments
Comments
(0)