fix: track PG19 node changes in vendored ruleutils - #236
Merged
Conversation
pg_ruleutils_19.c is a copy of PostgreSQL's ruleutils.c built against REL_19_STABLE tip, and it no longer compiles: 372b8d1adb reverted "Add GROUP BY ALL", removing Query.groupByAll, and 2a9541ddfd replaced ForPortionOfExpr.range_name with a Var *rangeVar. Both hunks come from REL_19_STABLE: drop the GROUP BY ALL branch, and give get_for_portion_of() a RangeTblEntry so it can resolve the column name with get_attname().
Collaborator
|
Thanks for PR. Would you add unit test of this bug? |
Collaborator
Oh I just saw the CI broken in main. yep, so this PR passes it. LGTM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
That file is a vendored copy of PostgreSQL's
ruleutils.c, and the matrix tracks REL_19_STABLE tip. Two upstream commits changed nodes it reads:372b8d1adbreverted "Add GROUP BY ALL" and removedQuery.groupByAll, and2a9541ddfdreplacedForPortionOfExpr.range_namewith aVar *rangeVarwhose column name is resolved from the catalogs at deparse time.Both hunks are taken from
ruleutils.cat REL_19_STABLE rather than written here: the GROUP BY ALL branch goes away, andget_for_portion_of()grows aRangeTblEntry *so it can callget_attname()on the range column. Only the_19file changes, so PG14 through PG18 are untouched.No PG19 server on hand, so this was checked by compiling the one translation unit against REL_19_STABLE headers (
9f6fb11): both errors reproduce before the change, and it compiles clean under-Wallafter. Not exercised at runtime.