GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [BUG] JSQLParser 5.3 : PostgreSQL : Cannot parse DROP COLUMN command where data is the column name · Issue #2339 · JSQLParser/JSqlParser

[BUG] JSQLParser 5.3 : PostgreSQL : Cannot parse DROP COLUMN command where data is the column name #2339

New issue
Copy link
New issue
Copy link
Closed
Closed
[BUG] JSQLParser 5.3 : PostgreSQL : Cannot parse DROP COLUMN command where data is the column name#2339
Copy link

Description

@willneedham93
willneedham93
opened on Nov 12, 2025
Issue body actions

Failing SQL Feature:

  • Cannot parse DROP COLUMN command where data is the column name
  • ALTER TABLE example DROP COLUMN data; can't be parsed

SQL Example:

  •   ALTER TABLE example DROP COLUMN data;

Software Information:

  • JSQLParser 5.3
  • PostgreSQL

Tips:

Appears that adding a column with name data works ok

Activity

  1. willneedham93 commented on Nov 12, 2025

    @willneedham93
    willneedham93
    on Nov 12, 2025
    ContributorAuthor
    More actions

    Can confirm adding tk=<K_DATA> as a case in the drop table identifier fixes this

  2. manticore-projects commented on Nov 13, 2025

    @manticore-projects
    manticore-projects
    on Nov 13, 2025
    Contributor
    More actions

    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.

    Reacted by William Needham
  3. willneedham93 commented on Nov 13, 2025

    @willneedham93
    willneedham93
    on Nov 13, 2025
    ContributorAuthor
    More actions

    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_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

  4. manticore-projects commented on Nov 13, 2025

    @manticore-projects
    manticore-projects
    on Nov 13, 2025
    Contributor
    More actions

    KeywordOrIdentifier() is not sufficient.
    You need RelObjectName instead.

  5. manticore-projects
    closed this as completedon Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.