Skip to content

Commit e72bb31

Browse files
kyleconroyclaude
andcommitted
Allow keywords as column names in ALTER UPDATE assignments
Column names like 'key' can be keywords. Allow keywords in addition to identifiers when parsing UPDATE assignment column names. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3d7ed55 commit e72bb31

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

parser/parser.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6034,7 +6034,8 @@ func (p *Parser) parseAlterCommand() *ast.AlterCommand {
60346034
p.nextToken() // skip UPDATE
60356035
// Parse assignments
60366036
for {
6037-
if !p.currentIs(token.IDENT) {
6037+
// Column name can be IDENT or keyword (e.g., key, value)
6038+
if !p.currentIs(token.IDENT) && !p.current.Token.IsKeyword() {
60386039
break
60396040
}
60406041
assign := &ast.Assignment{
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt7": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)