Skip to content

[BUG] JSQLParser Version 4.9 : RDBMS Postgresql 14.2 : Using Named Notation #2058

Open
@bigdream96

Description

@bigdream96

Failing SQL Feature:

When calling a PostgreSQL function, you can use the := operator by specifying the name of each argument.

  • The following error occurs when parsing:
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("
    at line 1, column 29.

Was expecting one of:

    "."
    "::"
    "["
    "^"
    <EOF>
    <ST_SEMICOLON>

        at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:39603) ~[jsqlparser-4.9.jar!/:na]
        at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:39427) ~[jsqlparser-4.9.jar!/:na]
        at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:317) ~[jsqlparser-4.9.jar!/:na]
        at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:339) ~[jsqlparser-4.9.jar!/:na]
        at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:336) ~[jsqlparser-4.9.jar!/:na]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
        ... 1 common frames omitted

SQL Example:

  • Simplified Query Example, focusing on the failing feature
SELECT concat_lower_or_upper(a := 'Hello', uppercase := true, b := 'World');

Software Information:

  • JSQLParser 4.9
  • PostgreSQL 14.2

Tips:

Newer versions of Postgresql use =>, but you can still use := for backwards compatibility, so I think it should be possible to parse it.

https://www.postgresql.org/docs/current/sql-syntax-calling-funcs.html#SQL-SYNTAX-CALLING-FUNCS-NAMED

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions