Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7986 +/- ##
=======================================
Coverage 89.20% 89.20%
=======================================
Files 284 284
Lines 61511 61515 +4
Branches 7695 7697 +2
=======================================
+ Hits 54869 54874 +5
+ Misses 4436 4435 -1
Partials 2206 2206 🚀 New features to boost your workflow:
|
| if (rangeTableEntry->relkind == RELKIND_VIEW || | ||
| rangeTableEntry->relkind == RELKIND_MATVIEW) | ||
| rangeTableEntry->relkind == RELKIND_MATVIEW || | ||
| (rangeTableEntry->rtekind == RTE_SUBQUERY && rangeTableEntry->relkind == 0)) |
There was a problem hiding this comment.
Note to reviewer:
When the rewriter converts an RTE_RELATION RTE for a view into
an RTE_SUBQUERY RTE containing the view's defining query, leave
the relid field alone instead of zeroing it. This allows the
planner to tell that the subquery came from a view rather than
having been written in-line, which is needed to support an
upcoming planner bug fix.
Above is the comment on the PG commit. Based on it, rangeTableEntry->rtekind == RTE_SUBQUERY check should be enough, but I added the rangeTableEntry->relkind == 0 just to be sure.
There was a problem hiding this comment.
And this works because PG's rewriteHandler explicitly sets relkind to 0 on that codepath.. Sgtm.
There was a problem hiding this comment.
On second look, it's better to separate this check for future PG15 support drop.
colm-mchugh
left a comment
There was a problem hiding this comment.
Lgtm, reminder to rebase onto latest main and update the commit message, thanks.
Sister PR citusdata/citus#7986 - Write permissions on packages need to be specified - Latest libdbd-pg-perl version (3.18.0-1) has dep: libpq5 (>= 17~~) So, it fails when we want to install PG15 and PG16. Therefore we specify a version that includes all three (15, 16, 17) - Since we drop PG14, we need to specify Citus 11.1.0 as the oldest version supporting PG15 (in citus upgrade tests)
Relevant PG commit: postgres/postgres@317aba70e Previously, when views were converted to RTE_SUBQUERY the relid would be cleared in PG15. In this patch of PG15, relid is retained. Therefore we add a check with the "relkind and rtekind" to identify the converted views.
c8b1282 to
dd6c858
Compare
Nontrivial bump because of the following PG15.3 commit 317aba70e postgres/postgres@317aba70e Previously, when views were converted to RTE_SUBQUERY the relid would be cleared in PG15. In this patch of PG15, relid is retained. Therefore, we add a check with the "relkind and rtekind" to identify the converted views in 15.13 Sister PR citusdata/the-process#164 Using dev image sha because I encountered the libpq symlink issue again with "-v219b87c"
Nontrivial bump because of the following PG15.3 commit 317aba70e postgres/postgres@317aba70e Previously, when views were converted to RTE_SUBQUERY the relid would be cleared in PG15. In this patch of PG15, relid is retained. Therefore, we add a check with the "relkind and rtekind" to identify the converted views in 15.13 Sister PR citusdata/the-process#164 Using dev image sha because I encountered the libpq symlink issue again with "-v219b87c"
Sister PR citusdata/the-process#164
Fixes #8059