You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] JSQLParser 5.3 : PostgreSQL : Cannot parse DROP COLUMN command where data is the column name #2339
According to https://manticore-projects.com/JSQLParser/syntax_snapshot.html#alterexpression we only allow <S_IDENTIFIER> | <S_QUOTED_IDENTIFIER> | "NAME" which excludes any defined token (like <K_DATA>).
The correct way would be to allow for RelObjName (which allows for all tokens that are not reserved keywords).
I can see we recently introduced KeywordOrIdentifier() as part of #2203, which appears to be used in other branches of alterexpression.
Would it be suitable to use that in the DROP branch for consistency and extend to additionally handle the K_DATA token? I have this working with a test case locally and am happy to raise a PR.
Although I am aware that continually appending tokens to that may not be ideal and refactoring to use RelObjectName may be preferred
Activity
willneedham93 commentedon Nov 12, 2025
Can confirm adding
tk=<K_DATA>as a case in the drop table identifier fixes thismanticore-projects commentedon Nov 13, 2025
Greetings.
According to https://manticore-projects.com/JSQLParser/syntax_snapshot.html#alterexpression we only allow
<S_IDENTIFIER> | <S_QUOTED_IDENTIFIER> | "NAME"which excludes any defined token (like<K_DATA>).The correct way would be to allow for
RelObjName(which allows for all tokens that are not reserved keywords).PRs are welcome.
willneedham93 commentedon Nov 13, 2025
Thanks for your time!
I can see we recently introduced KeywordOrIdentifier() as part of #2203, which appears to be used in other branches of
alterexpression.Would it be suitable to use that in the DROP branch for consistency and extend to additionally handle the
K_DATAtoken? I have this working with a test case locally and am happy to raise a PR.Although I am aware that continually appending tokens to that may not be ideal and refactoring to use RelObjectName may be preferred
manticore-projects commentedon Nov 13, 2025
KeywordOrIdentifier()is not sufficient.You need
RelObjectNameinstead.