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

Error when trying to parse SELECT query in Postgres #2315

Open
mhkeller opened this issue Jan 26, 2025 · 0 comments
Open

Error when trying to parse SELECT query in Postgres #2315

mhkeller opened this issue Jan 26, 2025 · 0 comments
Assignees

Comments

@mhkeller
Copy link

Describe the bug
I get an error when trying to parse a SELECT query

Full reproduction here: https://github.com/mhkeller/Node-SQL-Parser-error

Database Engine
PostgreSQL

To Reproduce
-the SQL that be parsed

SELECT
    gid,
    '2020-01-01 00:00:00'::TIMESTAMP WITH TIME ZONE + make_interval(secs => (
        (gid - (SELECT min(gid) FROM nyct20))::FLOAT / (SELECT max(gid) - min(gid) FROM nyct20)) * 31536000 -- One year in seconds
    ) AS generated_timestamp
FROM
    nyct20;

-the node-sql-parser version: 5.3.6
-the node version: 22.10

Expected behavior
It should parse the AST and say that it is a SELECT query

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

2 participants