Skip to content

Conversation

@teskje
Copy link
Contributor

@teskje teskje commented Jan 7, 2026

This PR changes the SQL syntax for replacement materialized views from
CREATE MATERIALIZED VIEW <name> REPLACING <target> AS <query>
to
CREATE REPLACEMENT MATERIALIZED VIEW <name> FOR <target> AS <query>

Discussion in Slack.

Motivation

  • This PR adds a known-desirable feature.

Part of https://github.com/MaterializeInc/database-issues/issues/9903

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@teskje teskje force-pushed the create-replacement-mv branch 6 times, most recently from 0491636 to b32d0a1 Compare January 8, 2026 16:28
@teskje teskje marked this pull request as ready for review January 9, 2026 10:14
@teskje teskje requested review from a team as code owners January 9, 2026 10:14
@teskje teskje requested review from SangJunBak and antiguru January 9, 2026 10:14
Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

Please remove Replacing from keywords.txt.

This commit changes the SQL syntax for replacement materialized views from
  `CREATE MATERIALIZED VIEW <name> REPLACING <target> AS <query>`
to
  `CREATE REPLACEMENT MATERIALIZED VIEW <name> FOR <target> AS <query>`
@teskje teskje force-pushed the create-replacement-mv branch from b32d0a1 to 336f1f9 Compare January 9, 2026 10:40
@teskje
Copy link
Contributor Author

teskje commented Jan 9, 2026

TFTR!

@teskje teskje merged commit 0eb4ee8 into MaterializeInc:main Jan 9, 2026
131 checks passed
@teskje teskje deleted the create-replacement-mv branch January 9, 2026 11:34
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