Skip to content

sql-parser: round-trip columns named like constraint keywords - #39619

Draft
antiguru wants to merge 1 commit into
mainfrom
mv-schema/constraint-lookahead
Draft

antiguru wants to merge 1 commit into
mainfrom
mv-schema/constraint-lookahead

Conversation

@antiguru

@antiguru antiguru commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Columns named primary, unique, foreign or check display unquoted, but the column-list parser took those keywords as the start of a table constraint, so a CREATE TABLE with such a column failed to re-parse from its displayed SQL. The parser now starts a constraint only when the next token fits one.

The declared materialized view schemas higher up this stack reuse the same parser, which is how this surfaced.

🤖 Generated with Claude Code

`PRIMARY`, `UNIQUE`, `FOREIGN` and `CHECK` are valid column names and
display unquoted, but the column list parser treated them as the start
of a table constraint. A table with such a column therefore failed to
re-parse from its displayed SQL. Only start a constraint if the next
token fits one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antiguru
antiguru added this pull request to stack #39622 October 7, 2026 07:04
@antiguru antiguru changed the title mv schema/constraint lookahead sql-parser: round-trip columns named like constraint keywords Oct 7, 2026

This branch has not been deployed

No deployments
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