Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implicit cast to "double precision" is not supported #1344

Closed
sixinli opened this issue Sep 23, 2021 · 6 comments
Closed

implicit cast to "double precision" is not supported #1344

sixinli opened this issue Sep 23, 2021 · 6 comments

Comments

@sixinli
Copy link

sixinli commented Sep 23, 2021

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

To Reproduce
Steps to reproduce the behavior:

  1. SELECT double precision '1'
  2. Parsing this SQL using JSqlParser with this statements
  3. org.junit.ComparisonFailure: Expected query to parse but it failed to parse (error: Encountered unexpected token: "\'1\'" <S_CHAR_LITERAL>

Expected behavior
query to parse

System

  • postgres
  • 15
  • 4.1
@manticore-projects
Copy link
Contributor

manticore-projects commented Sep 23, 2021

This kind of implicit cast is not supported (yet).
Please consider to use a Standard Compliant explicit cast:

SELECT CAST('1' AS DOUBLE)
;

@manticore-projects
Copy link
Contributor

This also seems to work:

SELECT '1'::Double
;

@sixinli
Copy link
Author

sixinli commented Oct 11, 2021

thanks for the workaround, it'd be great if this can be supported in the future though :)

@wumpz
Copy link
Member

wumpz commented Oct 14, 2021

double precision is definitly supported

select 1::double precision

however, this syntax double precision '1' is not.

@sixinli sixinli changed the title "double precision" can't be parsed implicit cast to "double precision" is not supported Oct 14, 2021
@sixinli
Copy link
Author

sixinli commented Oct 14, 2021

thanks for the note, updated the title :)

@manticore-projects
Copy link
Contributor

I am closing this since it is not support and won't be supported (unless any genius provided a PR).

manticore-projects added a commit that referenced this issue Apr 6, 2024
- fixes #1364
- fixes #1344

Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants