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

Parser throws syntax error on custom type in quotes in PostgreSQL #2045

Closed
1ilit opened this issue Aug 1, 2024 · 1 comment · Fixed by #2050
Closed

Parser throws syntax error on custom type in quotes in PostgreSQL #2045

1ilit opened this issue Aug 1, 2024 · 1 comment · Fixed by #2050
Assignees
Labels
bug Something isn't working
Milestone

Comments

@1ilit
Copy link

1ilit commented Aug 1, 2024

Describe the bug
astify() throws syntax error on custom type in quotes in PostgreSQL

Database Engine
PostgreSQL

To Reproduce
-the SQL that be parsed
This is ok

CREATE TYPE "Gender" AS ENUM ('F', 'M', 'U');

CREATE TABLE "User" (
    "gender" Gender NOT NULL
);

This throws an error

CREATE TYPE "Gender" AS ENUM ('F', 'M', 'U');

CREATE TABLE "User" (
    "gender" "Gender" NOT NULL
);

-the node-sql-parser version
v5.3.0
-the node version
v18.20.3

Expected behavior
Produce ast

Additional context
https://stackblitz.com/edit/stackblitz-starters-9dpxty?file=index.js

@taozhi8833998
Copy link
Owner

@1ilit fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants