Skip to content

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

Open
@ifrvn

Description

@ifrvn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions