Skip to content

Bump PG versions to 17.5, 16.9, 15.13#7986

Merged
naisila merged 5 commits intomainfrom
naisila/bump-pg-versions
May 22, 2025
Merged

Bump PG versions to 17.5, 16.9, 15.13#7986
naisila merged 5 commits intomainfrom
naisila/bump-pg-versions

Conversation

@naisila
Copy link
Copy Markdown
Contributor

@naisila naisila commented May 20, 2025

@codecov
Copy link
Copy Markdown

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.20%. Comparing base (8d2fbca) to head (545e298).
Report is 1 commits behind head on main.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@naisila naisila marked this pull request as ready for review May 20, 2025 14:50
if (rangeTableEntry->relkind == RELKIND_VIEW ||
rangeTableEntry->relkind == RELKIND_MATVIEW)
rangeTableEntry->relkind == RELKIND_MATVIEW ||
(rangeTableEntry->rtekind == RTE_SUBQUERY && rangeTableEntry->relkind == 0))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this works because PG's rewriteHandler explicitly sets relkind to 0 on that codepath.. Sgtm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second look, it's better to separate this check for future PG15 support drop.

@naisila naisila requested a review from colm-mchugh May 20, 2025 14:54
Copy link
Copy Markdown
Contributor

@colm-mchugh colm-mchugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, reminder to rebase onto latest main and update the commit message, thanks.

naisila added a commit to citusdata/the-process that referenced this pull request May 22, 2025
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)
naisila added 3 commits May 22, 2025 12:37
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.
@naisila naisila force-pushed the naisila/bump-pg-versions branch from c8b1282 to dd6c858 Compare May 22, 2025 10:45
@naisila naisila merged commit c98341e into main May 22, 2025
119 checks passed
@naisila naisila deleted the naisila/bump-pg-versions branch May 22, 2025 12:08
naisila added a commit that referenced this pull request May 22, 2025
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"
naisila added a commit that referenced this pull request May 22, 2025
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: UPDATE on reference table with subquery on view fails with "relation view_on_ref_tbl is not distributed" after PostgreSQL 13.21

2 participants