forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite5f455f
committed
Apply table and domain CHECK constraints in name order.
Previously, CHECK constraints of the same scope were checked in whateverorder they happened to be read from pg_constraint. (Usually, but notreliably, this would be creation order for domain constraints and reversecreation order for table constraints, because of differing implementationdetails.) Nondeterministic results of this sort are problematic at leastfor testing purposes, and in discussion it was agreed to be a violation ofthe principle of least astonishment. Therefore, borrow the principlealready established for triggers, and apply such checks in name order(using strcmp() sort rules). This lets users control the check orderif they have a mind to.Domain CHECK constraints still follow the rule of checking lower nesteddomains' constraints first; the name sort only applies to multipleconstraints attached to the same domain.In passing, I failed to resist the temptation to wordsmith a bit increate_domain.sgml.Apply to HEAD only, since this could result in a behavioral change inexisting applications, and the potential regression test failures havenot actually been observed in our buildfarm.1 parent871293f commite5f455f
File tree
6 files changed
+128
-23
lines changed- doc/src/sgml/ref
- src
- backend/utils/cache
- test/regress
- input
- output
6 files changed
+128
-23
lines changedLines changed: 40 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
| 142 | + | |
| 143 | + | |
148 | 144 |
| |
149 | 145 |
| |
150 | 146 |
| |
| |||
171 | 167 |
| |
172 | 168 |
| |
173 | 169 |
| |
174 |
| - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
175 | 174 |
| |
176 | 175 |
| |
177 | 176 |
| |
178 | 177 |
| |
179 | 178 |
| |
180 | 179 |
| |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
181 | 187 |
| |
182 | 188 |
| |
183 | 189 |
| |
184 | 190 |
| |
185 | 191 |
| |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
186 | 219 |
| |
187 | 220 |
| |
188 | 221 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
442 | 442 |
| |
443 | 443 |
| |
444 | 444 |
| |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
445 | 453 |
| |
446 | 454 |
| |
447 | 455 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
271 | 271 |
| |
272 | 272 |
| |
273 | 273 |
| |
| 274 | + | |
274 | 275 |
| |
275 | 276 |
| |
276 | 277 |
| |
| |||
3734 | 3735 |
| |
3735 | 3736 |
| |
3736 | 3737 |
| |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
3737 | 3754 |
| |
3738 | 3755 |
| |
3739 | 3756 |
| |
|
Lines changed: 53 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| 152 | + | |
152 | 153 |
| |
153 | 154 |
| |
154 | 155 |
| |
| |||
650 | 651 |
| |
651 | 652 |
| |
652 | 653 |
| |
| 654 | + | |
| 655 | + | |
653 | 656 |
| |
654 | 657 |
| |
655 | 658 |
| |
| |||
666 | 669 |
| |
667 | 670 |
| |
668 | 671 |
| |
669 |
| - | |
| 672 | + | |
| 673 | + | |
670 | 674 |
| |
671 | 675 |
| |
| 676 | + | |
| 677 | + | |
672 | 678 |
| |
673 | 679 |
| |
674 | 680 |
| |
| |||
682 | 688 |
| |
683 | 689 |
| |
684 | 690 |
| |
| 691 | + | |
685 | 692 |
| |
686 | 693 |
| |
687 | 694 |
| |
| |||
763 | 770 |
| |
764 | 771 |
| |
765 | 772 |
| |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
766 | 795 |
| |
767 |
| - | |
768 |
| - | |
| 796 | + | |
| 797 | + | |
769 | 798 |
| |
770 |
| - | |
| 799 | + | |
| 800 | + | |
771 | 801 |
| |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
772 | 809 |
| |
773 | 810 |
| |
774 | 811 |
| |
775 |
| - | |
776 |
| - | |
777 | 812 |
| |
778 | 813 |
| |
779 | 814 |
| |
| |||
836 | 871 |
| |
837 | 872 |
| |
838 | 873 |
| |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
839 | 886 |
| |
840 | 887 |
| |
841 | 888 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
90 |
| - | |
| 90 | + | |
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
|
Lines changed: 9 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
119 |
| - | |
| 119 | + | |
120 | 120 |
| |
121 | 121 |
| |
122 |
| - | |
| 122 | + | |
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
| |||
133 | 133 |
| |
134 | 134 |
| |
135 | 135 |
| |
136 |
| - | |
| 136 | + | |
137 | 137 |
| |
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
144 |
| - | |
| 144 | + | |
145 | 145 |
| |
146 | 146 |
| |
147 | 147 |
| |
| |||
158 | 158 |
| |
159 | 159 |
| |
160 | 160 |
| |
161 |
| - | |
| 161 | + | |
162 | 162 |
| |
163 | 163 |
| |
164 | 164 |
| |
| |||
180 | 180 |
| |
181 | 181 |
| |
182 | 182 |
| |
183 |
| - | |
| 183 | + | |
184 | 184 |
| |
185 | 185 |
| |
186 | 186 |
| |
| |||
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
245 |
| - | |
| 245 | + | |
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
| |||
305 | 305 |
| |
306 | 306 |
| |
307 | 307 |
| |
308 |
| - | |
| 308 | + | |
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
| |||
325 | 325 |
| |
326 | 326 |
| |
327 | 327 |
| |
328 |
| - | |
| 328 | + | |
329 | 329 |
| |
330 | 330 |
| |
331 | 331 |
| |
|
0 commit comments
Comments
(0)