- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit28a7e31
committed
Preserve RangeTblEntry.relid when expanding a view RTE.
When the rewriter converts an RTE_RELATION RTE for a view intoan RTE_SUBQUERY RTE containing the view's defining query, leavethe relid field alone instead of zeroing it. This allows theplanner to tell that the subquery came from a view rather thanhaving been written in-line, which is needed to support anupcoming planner bug fix. We cannot change the behavior of theoutfuncs/readfuncs code in released branches, so the relid fieldwill not survive in plans passed to parallel workers; thereforethis info should not be relied on in the executor.This back-patches a portion of the data structure definitionalchanges made in v16 and up by commit47bb9db. It's beingcommitted separately for visibility in the commit log, butwith luck it will not actually matter to anyone. While it'snot inconceivable that this change will break code expectingrelid to be zero in a subquery RTE, we can hope that such codehas already been adjusted to cope with v16 and up.Reported-by: Duncan Sands <duncan.sands@deepbluecap.com>Diagnosed-by: Tender Wang <tndrwang@gmail.com>Author: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>Discussion:https://postgr.es/m/3518c50a-ab18-482f-b916-a37263622501@deepbluecap.comBackpatch-through: 13-151 parentf5b4a0b commit28a7e31
File tree
2 files changed
+12
-2
lines changed- src
- backend/rewrite
- include/nodes
2 files changed
+12
-2
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1825 | 1825 |
| |
1826 | 1826 |
| |
1827 | 1827 |
| |
1828 |
| - | |
1829 |
| - | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1830 | 1834 |
| |
1831 | 1835 |
| |
1832 | 1836 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
982 | 982 |
| |
983 | 983 |
| |
984 | 984 |
| |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
985 | 991 |
| |
986 | 992 |
| |
987 | 993 |
| |
|
0 commit comments
Comments
(0)