Skip to content

Comments

Fix continuous aggregate column rename breaking materialized_only toggle#9292

Merged
svenklemm merged 1 commit intomainfrom
sven/cagg_rename
Feb 25, 2026
Merged

Fix continuous aggregate column rename breaking materialized_only toggle#9292
svenklemm merged 1 commit intomainfrom
sven/cagg_rename

Conversation

@svenklemm
Copy link
Member

Renaming a column on a continuous aggregate left the stored query trees
in pg_rewrite out of sync with pg_attribute. Toggling materialized_only
afterwards failed with "SELECT rule's target entry has different column
name" because build_union_query / destroy_union_query read stale names.

The start handler now returns DDL_DONE for continuous aggregates since
all views (including the user view) are renamed explicitly, and
PostgreSQL's standard rename must be skipped to avoid a double-rename
error.

Fixes #7800

@svenklemm svenklemm requested a review from a team February 21, 2026 15:59
@github-actions github-actions bot requested review from erimatnor and pnthao February 21, 2026 15:59
@github-actions
Copy link

@pnthao, @erimatnor: please review this pull request.

Powered by pull-review

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 83.78378% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tsl/src/continuous_aggs/create.c 81.48% 1 Missing and 4 partials ⚠️
tsl/src/process_utility.c 50.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@svenklemm svenklemm added this to the v2.25.2 milestone Feb 23, 2026
@svenklemm svenklemm force-pushed the sven/cagg_rename branch 2 times, most recently from 9868e6d to b19d6e3 Compare February 24, 2026 15:41
Renaming a column on a continuous aggregate left the stored query trees
in pg_rewrite out of sync with pg_attribute. Toggling materialized_only
afterwards failed with "SELECT rule's target entry has different column
name" because build_union_query / destroy_union_query read stale names.

The start handler now returns DDL_DONE for continuous aggregates since
all views (including the user view) are renamed explicitly, and
PostgreSQL's standard rename must be skipped to avoid a double-rename
error.

Fixes #7800
@svenklemm svenklemm merged commit cd27ac8 into main Feb 25, 2026
51 of 52 checks passed
@svenklemm svenklemm deleted the sven/cagg_rename branch February 25, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Renaming Columns in CAggs causes issues when altering timescaledb.materialized_only

5 participants