- Notifications
You must be signed in to change notification settings - Fork28
Commite240a65
committed
Provide an error cursor for "can't call an SRF here" errors.
Since it appears that v10 is going to move the goalposts by some amountin terms of where you can and can't invoke set-returning functions,arrange for the executor's "set-valued function called in context thatcannot accept a set" errors to include a syntax position if possible,pointing to the specific SRF that can't be called where it's located.The main bit of infrastructure needed for this is to make the query sourcetext accessible in the executor; but it turns out that commit4c728f3already did that. We just need a new function executor_errposition()modeled on parser_errposition(), and we're ready to rock.While experimenting with this, I noted that the error position wasn'tproperly reported if it occurred in a plpgsql FOR-over-query loop,which turned out to be because SPI_cursor_open_internal wasn't providingan error context callback during PortalStart. Fix that.There's a whole lot more that could be done with this infrastructurenow that it's there, but this is not the right time in the developmentcycle for that sort of work. Hence, resist the temptation to plasterexecutor_errposition() calls everywhere ... for the moment.Discussion:https://postgr.es/m/5263.1492471571@sss.pgh.pa.us1 parent280c53e commite240a65
File tree
6 files changed
+57
-10
lines changed- src
- backend/executor
- include/executor
- test/regress/expected
6 files changed
+57
-10
lines changedLines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2103 | 2103 |
| |
2104 | 2104 |
| |
2105 | 2105 |
| |
2106 |
| - | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
2107 | 2109 |
| |
2108 | 2110 |
| |
2109 | 2111 |
| |
|
Lines changed: 10 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| |||
77 | 78 |
| |
78 | 79 |
| |
79 | 80 |
| |
80 |
| - | |
| 81 | + | |
81 | 82 |
| |
82 | 83 |
| |
83 | 84 |
| |
| |||
438 | 439 |
| |
439 | 440 |
| |
440 | 441 |
| |
441 |
| - | |
| 442 | + | |
442 | 443 |
| |
443 | 444 |
| |
444 | 445 |
| |
445 | 446 |
| |
446 | 447 |
| |
447 | 448 |
| |
448 | 449 |
| |
449 |
| - | |
| 450 | + | |
450 | 451 |
| |
451 | 452 |
| |
452 | 453 |
| |
| |||
645 | 646 |
| |
646 | 647 |
| |
647 | 648 |
| |
648 |
| - | |
| 649 | + | |
| 650 | + | |
649 | 651 |
| |
650 | 652 |
| |
651 | 653 |
| |
| |||
683 | 685 |
| |
684 | 686 |
| |
685 | 687 |
| |
686 |
| - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
687 | 691 |
| |
688 | 692 |
| |
689 | 693 |
| |
|
Lines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
| 32 | + | |
31 | 33 |
| |
32 | 34 |
| |
33 | 35 |
| |
| |||
44 | 46 |
| |
45 | 47 |
| |
46 | 48 |
| |
| 49 | + | |
47 | 50 |
| |
48 | 51 |
| |
49 | 52 |
| |
| |||
685 | 688 |
| |
686 | 689 |
| |
687 | 690 |
| |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
688 | 721 |
| |
689 | 722 |
| |
690 | 723 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1197 | 1197 |
| |
1198 | 1198 |
| |
1199 | 1199 |
| |
1200 |
| - | |
1201 |
| - | |
1202 |
| - | |
1203 | 1200 |
| |
1204 | 1201 |
| |
1205 | 1202 |
| |
| |||
1318 | 1315 |
| |
1319 | 1316 |
| |
1320 | 1317 |
| |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
1321 | 1321 |
| |
1322 | 1322 |
| |
1323 | 1323 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
482 | 482 |
| |
483 | 483 |
| |
484 | 484 |
| |
| 485 | + | |
| 486 | + | |
485 | 487 |
| |
486 | 488 |
| |
487 | 489 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
193 | 193 |
| |
194 | 194 |
| |
195 | 195 |
| |
| 196 | + | |
| 197 | + | |
196 | 198 |
| |
197 | 199 |
| |
198 | 200 |
| |
| 201 | + | |
| 202 | + | |
199 | 203 |
| |
200 | 204 |
| |
201 | 205 |
| |
| |||
424 | 428 |
| |
425 | 429 |
| |
426 | 430 |
| |
| 431 | + | |
| 432 | + | |
427 | 433 |
| |
428 | 434 |
| |
429 | 435 |
| |
|
0 commit comments
Comments
(0)