JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

postgres `@` for abs number doesn't work

Open sixinli opened this issue 2 years ago • 2 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. select @(-1)
  2. Parsing this SQL using JSqlParser with this statements
org.junit.ComparisonFailure: Expected query to parse but it failed to parse (error: Encountered unexpected token: "(" "("
    at line 1, column 9.

Expected behavior query parses, docs here https://www.postgresql.org/docs/9.5/functions-math.html

select abs(-1) works

System

  • postgres
  • Java11
  • JSqlParser 4.2

sixinli avatar Oct 26 '21 19:10 sixinli

Not supported in JSQLParser (and if you ask me, Postgres should not support this either). I can only guess that this an Ingres heritage.

You best bet would be to submit a PR.

manticore-projects avatar Oct 26 '21 19:10 manticore-projects

Sorry, but to be honest regarding readability this is IMHO a disaster. :/

wumpz avatar Nov 19 '21 20:11 wumpz