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
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.
for named parameters, "=>" is pretty much the established and accepted standard and JSQLParser supports this and Postgres does too.
If you are interested in supporting this legacy Postgres behavior you would need to sponsor or provide an implementation (which does not deteriorate the performance too much -- adding more features to the grammar always comes at a cost unfortunately.)
Failing SQL Feature:
When calling a PostgreSQL function, you can use the
:=
operator by specifying the name of each argument.SQL Example:
Software Information:
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
The text was updated successfully, but these errors were encountered: