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

[Bug] PostgreSQL - Import SQL faild when using custom type with double quotes #196

Open
ifrvn opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ifrvn
Copy link

ifrvn commented Jul 31, 2024

When setting a custom type with double quotes in create table, import this sql file, drawdb throws an error.

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

CREATE TABLE "User" (
    "id" SERIAL NOT NULL,
    "gender" "Gender" NOT NULL,

    CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);

image

SyntaxError [Ln 5, Col 14]: Expected "--", "->", "->>", ".", "/*", "BIGINT", "BIGSERIAL", "BOOL", "BOOLEAN", "CHAR", "CHARACTER", "DATE", "DATETIME", "DECIMAL", "DOUBLE", "ENUM", "FLOAT", "GEOMETRY", "INT", "INTEGER", "INTERVAL", "JSON", "JSONB", "LONGTEXT", "MEDIUMTEXT", "NUMERIC", "OID", "REAL", "RECORD", "REGCLASS", "REGCOLLATION", "REGCONFIG", "REGDICTIONARY", "REGNAMESPACE", "REGOPER", "REGOPERATOR", "REGPROC", "REGPROCEDURE", "REGROLE", "REGTYPE", "SERIAL", "SMALLINT", "TEXT", "TIME", "TIMESTAMP", "TINYINT", "TINYTEXT", "UUID", "VARCHAR", "bytea", [ \t\n\r], or [A-Za-z_一-龥] but """ found.

If I remove double quotes from "gender" "Gender" NOT NULL,, it'll work.

@ifrvn ifrvn changed the title PostgreSQL - Import SQL faild if using custom type with double quotes [Bug] PostgreSQL - Import SQL faild when using custom type with double quotes Aug 1, 2024
@1ilit
Copy link
Member

1ilit commented Aug 1, 2024

Submitted an issue for this taozhi8833998/node-sql-parser#2045.

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

No branches or pull requests

2 participants