fix(parser): allow VERSION in ALTER column clauses - #2530
Merged
manticore-projects merged 1 commit intoSep 3, 2026
Conversation
VERSION is non-reserved, but restricted legacy productions reject it in DROP COLUMN and USING clauses. Accept the token in those productions and cover both PostgreSQL corpus cases.
minleejae
force-pushed
the
fix/version-alter-column
branch
from
September 3, 2026 06:26
7837250 to
744dfc1
Compare
Contributor
|
thank you!! |
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.
What
VERSIONkeyword to be used as a column identifier in the restrictedKeywordOrIdentifierproduction used byALTER TABLE.VERSIONinCreateParameter, which currently captures PostgreSQLUSINGexpressions attached toALTER COLUMN ... TYPE.DROP COLUMN versionandALTER COLUMN version TYPE ... USING version::....Why
VERSIONis already declared as a non-reserved keyword, but two narrower legacy productions do not accept it. As a result, valid PostgreSQL statements such as these fail on the currentmasterbranch:PostgreSQL allows non-reserved keywords to be used as identifiers. This change is intentionally limited to the two productions exercised by these statements and introduces no new JavaCC choice conflicts.
PostgreSQL keyword reference: https://www.postgresql.org/docs/current/sql-keywords-appendix.html
Testing
./gradlew checkAlterTestand verified parse/deparse round trips.AI assistance
OpenAI Codex was used to identify the regression from a PostgreSQL ALTER corpus, prepare the focused grammar change, and run validation. The generated change and tests were reviewed against the PostgreSQL documentation.