forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit599b33b
committed
Stop accessing checkAsUser via RTE in some cases
A future commit will move the checkAsUser field from RangeTblEntryto a new node that, unlike RTEs, will only be created for tablesmentioned in the query but not for the inheritance child relationsadded to the query by the planner. So, checkAsUser value for agiven child relation will have to be obtained by referring to thatfor its ancestor mentioned in the query.In preparation, it seems better to expand the use of RelOptInfo.useridduring planning in place of rte->checkAsUser so that there will befewer places to adjust for the above change.Given that the child-to-ancestor mapping is not available during theexecution of a given "child" ForeignScan node, add a checkAsUserfield to ForeignScan to carry the child relation's RelOptInfo.userid.Author: Amit Langote <amitlangote09@gmail.com>Discussion:https://postgr.es/m/CA+HiwqGFCs2uq7VRKi7g+FFKbP6Ea_2_HkgZb2HPhUfaAKT3ng@mail.gmail.com1 parentd2a4490 commit599b33b
File tree
9 files changed
+39
-30
lines changed- contrib/postgres_fdw
- src
- backend
- executor
- optimizer/plan
- rewrite
- statistics
- utils
- adt
- misc
- include/nodes
9 files changed
+39
-30
lines changedLines changed: 7 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
624 | 624 |
| |
625 | 625 |
| |
626 | 626 |
| |
627 |
| - | |
628 | 627 |
| |
629 | 628 |
| |
630 | 629 |
| |
| |||
663 | 662 |
| |
664 | 663 |
| |
665 | 664 |
| |
666 |
| - | |
| 665 | + | |
667 | 666 |
| |
| 667 | + | |
668 | 668 |
| |
669 | 669 |
| |
670 | 670 |
| |
| |||
1510 | 1510 |
| |
1511 | 1511 |
| |
1512 | 1512 |
| |
1513 |
| - | |
1514 |
| - | |
1515 |
| - | |
| 1513 | + | |
1516 | 1514 |
| |
| 1515 | + | |
1517 | 1516 |
| |
1518 | 1517 |
| |
1519 | 1518 |
| |
1520 | 1519 |
| |
1521 | 1520 |
| |
1522 |
| - | |
1523 | 1521 |
| |
1524 | 1522 |
| |
1525 | 1523 |
| |
| |||
2633 | 2631 |
| |
2634 | 2632 |
| |
2635 | 2633 |
| |
2636 |
| - | |
2637 | 2634 |
| |
2638 | 2635 |
| |
2639 | 2636 |
| |
| |||
2655 | 2652 |
| |
2656 | 2653 |
| |
2657 | 2654 |
| |
2658 |
| - | |
2659 |
| - | |
2660 |
| - | |
| 2655 | + | |
2661 | 2656 |
| |
2662 | 2657 |
| |
| 2658 | + | |
2663 | 2659 |
| |
2664 | 2660 |
| |
2665 | 2661 |
| |
| |||
3983 | 3979 |
| |
3984 | 3980 |
| |
3985 | 3981 |
| |
3986 |
| - | |
| 3982 | + | |
3987 | 3983 |
| |
3988 | 3984 |
| |
3989 | 3985 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
631 | 631 |
| |
632 | 632 |
| |
633 | 633 |
| |
634 |
| - | |
| 634 | + | |
635 | 635 |
| |
636 | 636 |
| |
637 | 637 |
| |
|
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4148 | 4148 |
| |
4149 | 4149 |
| |
4150 | 4150 |
| |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
4151 | 4154 |
| |
4152 | 4155 |
| |
4153 | 4156 |
| |
| |||
5794 | 5797 |
| |
5795 | 5798 |
| |
5796 | 5799 |
| |
5797 |
| - | |
| 5800 | + | |
| 5801 | + | |
5798 | 5802 |
| |
5799 | 5803 |
| |
5800 | 5804 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
131 |
| - | |
| 131 | + | |
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1598 | 1598 |
| |
1599 | 1599 |
| |
1600 | 1600 |
| |
| 1601 | + | |
1601 | 1602 |
| |
1602 | 1603 |
| |
1603 | 1604 |
| |
| |||
1646 | 1647 |
| |
1647 | 1648 |
| |
1648 | 1649 |
| |
1649 |
| - | |
1650 |
| - | |
| 1650 | + | |
1651 | 1651 |
| |
1652 |
| - | |
| 1652 | + | |
1653 | 1653 |
| |
1654 | 1654 |
| |
1655 | 1655 |
| |
|
Lines changed: 18 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5155 | 5155 |
| |
5156 | 5156 |
| |
5157 | 5157 |
| |
5158 |
| - | |
5159 |
| - | |
| 5158 | + | |
| 5159 | + | |
5160 | 5160 |
| |
5161 |
| - | |
| 5161 | + | |
| 5162 | + | |
5162 | 5163 |
| |
5163 | 5164 |
| |
5164 | 5165 |
| |
| |||
5210 | 5211 |
| |
5211 | 5212 |
| |
5212 | 5213 |
| |
5213 |
| - | |
| 5214 | + | |
| 5215 | + | |
5214 | 5216 |
| |
5215 | 5217 |
| |
5216 | 5218 |
| |
| |||
5290 | 5292 |
| |
5291 | 5293 |
| |
5292 | 5294 |
| |
5293 |
| - | |
| 5295 | + | |
5294 | 5296 |
| |
5295 | 5297 |
| |
5296 |
| - | |
| 5298 | + | |
| 5299 | + | |
5297 | 5300 |
| |
5298 | 5301 |
| |
5299 | 5302 |
| |
| |||
5341 | 5344 |
| |
5342 | 5345 |
| |
5343 | 5346 |
| |
5344 |
| - | |
| 5347 | + | |
| 5348 | + | |
5345 | 5349 |
| |
5346 | 5350 |
| |
5347 | 5351 |
| |
| |||
5402 | 5406 |
| |
5403 | 5407 |
| |
5404 | 5408 |
| |
| 5409 | + | |
5405 | 5410 |
| |
5406 | 5411 |
| |
5407 | 5412 |
| |
5408 | 5413 |
| |
5409 | 5414 |
| |
5410 |
| - | |
5411 |
| - | |
| 5415 | + | |
| 5416 | + | |
| 5417 | + | |
5412 | 5418 |
| |
5413 |
| - | |
| 5419 | + | |
5414 | 5420 |
| |
5415 | 5421 |
| |
5416 | 5422 |
| |
| |||
5479 | 5485 |
| |
5480 | 5486 |
| |
5481 | 5487 |
| |
5482 |
| - | |
| 5488 | + | |
| 5489 | + | |
5483 | 5490 |
| |
5484 | 5491 |
| |
5485 | 5492 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
54 |
| - | |
| 54 | + | |
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
901 | 901 |
| |
902 | 902 |
| |
903 | 903 |
| |
904 |
| - | |
| 904 | + | |
905 | 905 |
| |
906 | 906 |
| |
907 | 907 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
703 | 703 |
| |
704 | 704 |
| |
705 | 705 |
| |
| 706 | + | |
| 707 | + | |
706 | 708 |
| |
707 | 709 |
| |
708 | 710 |
| |
|
0 commit comments
Comments
(0)