Repository navigation
PostgreSQL: Support ALTER MATERIALIZED VIEW - #2776
Merged
Merged
Conversation
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 30, 2026 09:32
4f339b0 to
e241480
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2776 +/- ##
=======================================
Coverage 83.02% 83.02%
=======================================
Files 42 42
Lines 36220 36227 +7
Branches 36220 36227 +7
=======================================
+ Hits 30070 30077 +7
Misses 2652 2652
Partials 3498 3498 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 30, 2026 10:56
e241480 to
39b7beb
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 30, 2026 15:05
39b7beb to
e6a8210
Compare
sabir-akhadov-localstack
approved these changes
Oct 30, 2026
| old_column_name, | ||
| new_column_name: self.parse_identifier()?, | ||
| } | ||
| } else if materialized { |
Contributor
There was a problem hiding this comment.
PG 16 does accept ALTER MATERIALIZED VIEW m ALTER COLUMN c SET STATISTICS 100 / SET (n_distinct = 10) / SET STORAGE PLAIN; only SET/DROP DEFAULT is refused. This branch will have to be undone once AlterColumn grows those variants, so it may be simpler to drop it now and let AS/default-related forms fall through as they do for plain views.
Contributor
Author
There was a problem hiding this comment.
Fixed, and added the adequate tests.
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
2 times, most recently
from
October 30, 2026 18:11
62b3fcd to
3b652c6
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 30, 2026 22:29
3b652c6 to
0d725d4
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 31, 2026 07:55
0d725d4 to
c81c8ac
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 31, 2026 08:32
c81c8ac to
d10da44
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 31, 2026 08:46
d10da44 to
888f8c1
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 31, 2026 10:00
888f8c1 to
6bac6ca
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 31, 2026 12:39
6bac6ca to
145e5cd
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
October 31, 2026 13:29
cf5f8f5 to
f6447ab
Compare
LucaCappelletti94
force-pushed
the
upstream/alter-materialized-view
branch
from
November 1, 2026 14:46
f6447ab to
11c3bf3
Compare
alamb
approved these changes
Nov 2, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 2, 2026
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.
ALTER MATERIALIZED VIEWdid not parse. AfterALTERthe parser expected an object keyword and stopped atMATERIALIZED, so a PostgreSQL schema that hands a materialized view to its owner, renames it or sets a storage parameter on it could not be read.The statement reuses the
AlterViewnode from #2730 with amaterializedflag, since the two share their operations.OWNER TO,RENAME TO,RENAME COLUMN,SET SCHEMA,SET (...)andRESET (...)parse and round-trip throughDisplay, andASandALTER COLUMNstay refused afterMATERIALIZED.