forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit915de70
committed
Fix infer_arbiter_indexes() to not assume resultRelation is 1.
infer_arbiter_indexes failed to renumber varnos in index expressionsor predicates that it got from the catalogs. This escaped detectionup to now because the stored varnos in such trees will be 1, and anINSERT's result relation is usually the first rangetable entry,so that that was fine. However, in cases such as inserting throughan updatable view, it's not fine, leading to failure to match theexpressions to the query with ensuing "there is no unique or exclusionconstraint matching the ON CONFLICT specification" errors.Fix by copy-and-paste from get_relation_info().Per bug #18502 from Michael Wang. Back-patch to all supportedversions.Discussion:https://postgr.es/m/18502-545b53f5b81e54e0@postgresql.org1 parentc2fab70 commit915de70
File tree
3 files changed
+27
-1
lines changed- src
- backend/optimizer/util
- test/regress
- expected
- sql
3 files changed
+27
-1
lines changedLines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
695 | 695 |
| |
696 | 696 |
| |
697 | 697 |
| |
| 698 | + | |
698 | 699 |
| |
699 | 700 |
| |
700 | 701 |
| |
| |||
723 | 724 |
| |
724 | 725 |
| |
725 | 726 |
| |
726 |
| - | |
| 727 | + | |
| 728 | + | |
727 | 729 |
| |
728 | 730 |
| |
729 | 731 |
| |
| |||
857 | 859 |
| |
858 | 860 |
| |
859 | 861 |
| |
| 862 | + | |
| 863 | + | |
| 864 | + | |
860 | 865 |
| |
861 | 866 |
| |
862 | 867 |
| |
| |||
908 | 913 |
| |
909 | 914 |
| |
910 | 915 |
| |
| 916 | + | |
| 917 | + | |
911 | 918 |
| |
912 | 919 |
| |
913 | 920 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| 5 | + | |
| 6 | + | |
5 | 7 |
| |
6 | 8 |
| |
7 | 9 |
| |
| |||
43 | 45 |
| |
44 | 46 |
| |
45 | 47 |
| |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
46 | 57 |
| |
47 | 58 |
| |
48 | 59 |
| |
| |||
380 | 391 |
| |
381 | 392 |
| |
382 | 393 |
| |
| 394 | + | |
383 | 395 |
| |
384 | 396 |
| |
385 | 397 |
| |
| |||
445 | 457 |
| |
446 | 458 |
| |
447 | 459 |
| |
| 460 | + | |
448 | 461 |
| |
449 | 462 |
| |
450 | 463 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 |
| |
7 | 10 |
| |
8 | 11 |
| |
| |||
20 | 23 |
| |
21 | 24 |
| |
22 | 25 |
| |
| 26 | + | |
23 | 27 |
| |
24 | 28 |
| |
25 | 29 |
| |
| |||
218 | 222 |
| |
219 | 223 |
| |
220 | 224 |
| |
| 225 | + | |
221 | 226 |
| |
222 | 227 |
| |
223 | 228 |
| |
| |||
250 | 255 |
| |
251 | 256 |
| |
252 | 257 |
| |
| 258 | + | |
253 | 259 |
| |
254 | 260 |
| |
255 | 261 |
| |
|
0 commit comments
Comments
(0)