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
Trying to parse the following query throws an exception.
SELECT *
FROM crosstab(
'select rowid, attribute, value
from ct
where attribute = ''att2'' or attribute = ''att3''
order by 1,2')
AS ct(row_name text, category_1 text, category_2 text, category_3 text);
Expected behavior
It is possible to parse the statement.
Actual behaviour
The following exception is thrown:
net.sf.jsqlparser.JSQLParserException
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:51)
...
<SNIPPED>
...
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("
at line 8, column 6.
Was expecting one of:
...
System
Database you are using: Postgres
Java Version: 11.0.3
JSqlParser version: 3.0
The text was updated successfully, but these errors were encountered:
I don't think ct(row_name text, category_1 text, category_2 text, category_3 text) is a multi-name alias. The syntax for the crosstab function extends the usual alias and the parser doesn't seem to be handling this.
Describe the bug
Trying to parse a query with crosstab function of Postgres fails.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It is possible to parse the statement.
Actual behaviour
The following exception is thrown:
System
The text was updated successfully, but these errors were encountered: