Skip to content

fix: track PG19 node changes in vendored ruleutils - #236

Merged
qsliu2017 merged 1 commit into
relytcloud:mainfrom
GavinPizza:fix/pg19-ruleutils-drift
Jul 29, 2026
Merged

fix: track PG19 node changes in vendored ruleutils#236
qsliu2017 merged 1 commit into
relytcloud:mainfrom
GavinPizza:fix/pg19-ruleutils-drift

Conversation

@GavinPizza

Copy link
Copy Markdown
Contributor
libpgduckdb/vendor/pg_ruleutils_19.c:6565:26: error: 'Query' has no member named 'groupByAll'
libpgduckdb/vendor/pg_ruleutils_19.c:13444:81: error: 'ForPortionOfExpr' has no member named 'range_name'; did you mean 'rangeVar'?

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: 372b8d1adb reverted "Add GROUP BY ALL" and removed Query.groupByAll, and 2a9541ddfd replaced ForPortionOfExpr.range_name with a Var *rangeVar whose column name is resolved from the catalogs at deparse time.

Both hunks are taken from ruleutils.c at REL_19_STABLE rather than written here: the GROUP BY ALL branch goes away, and get_for_portion_of() grows a RangeTblEntry * so it can call get_attname() on the range column. Only the _19 file 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 -Wall after. Not exercised at runtime.

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().
@qsliu2017

Copy link
Copy Markdown
Collaborator

Thanks for PR. Would you add unit test of this bug?

@qsliu2017

Copy link
Copy Markdown
Collaborator

Thanks for PR. Would you add unit test of this bug?

Oh I just saw the CI broken in main. yep, so this PR passes it. LGTM!

@qsliu2017
qsliu2017 merged commit 3e33417 into relytcloud:main Jul 29, 2026
13 checks passed
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.

2 participants