Skip to content

[BUG] JSQLParser Version : 5.3 RDBMS : PostgreSQL Parse error for EXPLAIN DELETE/UPDATE/INSERT #2373

Closed

Description

@SuperPat45

Failing SQL Feature:

  • The EXPLAIN statement seem to only works for SELECT statements

SQL Example:

  • Simplified Query Example, focusing on the failing feature
    EXPLAIN DELETE FROM test;

Software Information:

  • JSqlParser version 5.3
  • Database PostgreSQL version 17.7

Tips:

http://jsqlformatter.manticore-projects.com/jsqlformatter/demo.html?args=-c%20KIDQCgMgggkgcgAgCLAsAKsBAxASgeQFkEAXAUwGcSg$

The error is:

net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "FROM" "FROM"
at line 1, column 16.

Was expecting one of:

<EOF>
<ST_SEMICOLON>

at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:444)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:414)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:377)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:367)

Activity

  1. dengliming commented on Feb 24, 2026

    @dengliming
    Contributor

    Although this is a sql parsing component, most of the scenarios are select. I'm more interested in what the business scenario is?

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