Skip to content

Fix ALTER MATERIALIZED VIEW ... REBALANCE#2246

Merged
whitehawk merged 1 commit intofeature/ADBDEV-6608from
GG-186
Feb 13, 2026
Merged

Fix ALTER MATERIALIZED VIEW ... REBALANCE#2246
whitehawk merged 1 commit intofeature/ADBDEV-6608from
GG-186

Conversation

@whitehawk
Copy link

@whitehawk whitehawk commented Feb 10, 2026

Fix 'ALTER MATERIALIZED VIEW ... REBALANCE' command

Problem description:
Attempts to rebalance a materialized view via
'ALTER MATERIALIZED VIEW ... REBALANCE' command (or via equivalently working for
materialized views 'ALTER TABLE ... REBALANCE') ended with an error:
'ERROR: cannot change materialized view ...'

Root cause:
The table rebalance logic tried to insert the data directly into the
materialized view as if it were an ordinary table. It is prohibited for
materialized views.

Fix:
Skip the call of 'ATExecShrinkTable()' for the materialized views. So during
'ALTER ... REBALANCE' only the distribution policy for the materialized view is
updated. And the user needs to perform 'REFRESH MATERIALIZED VIEW ...' after
the rebalance.

@whitehawk whitehawk marked this pull request as ready for review February 11, 2026 00:26
@whitehawk whitehawk merged commit a3eb478 into feature/ADBDEV-6608 Feb 13, 2026
3 of 5 checks passed
@whitehawk whitehawk deleted the GG-186 branch February 13, 2026 07:59
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.

3 participants

Comments