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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug: Import excel throw 42701 Error #6998

Closed
1 task done
xJkit opened this issue Nov 16, 2023 · 2 comments 路 Fixed by #7022
Closed
1 task done

馃悰 Bug: Import excel throw 42701 Error #6998

xJkit opened this issue Nov 16, 2023 · 2 comments 路 Fixed by #7022
Assignees
Labels
馃悰 Type: Bug Something is broken or incorrect unexpectedly.

Comments

@xJkit
Copy link

xJkit commented Nov 16, 2023

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

import the excel file as provided. It throw an error.

The Web UI says "The column already exists." which is really confusing.

According to the server messages, it indicates that the column field specified more than once. However, there is no field called field. All of fields are renamed.

Please check the attachments for screenshot and excel example for more detail.

error: /* xc */
CREATE TABLE "nc_y35o___鍟嗗搧娓呭柈" ( "ID" bigint NOT NULL, "SKU" bool NULL DEFAULT false, "field" character varying NULL, "field" text NULL, "field" bigint NULL, "field" date NULL, "field" date NULL, "field" date NULL, "created_at" timestamp NULL DEFAULT now(), "updated_at" timestamp NULL DEFAULT now(), PRIMARY KEY("ID")); - column "field" specified more than once
    at Parser.parseErrorMessage (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:514:28)
    at Socket.emit (node:domain:488:12)
    at addChunk (node:internal/streams/readable:376:12)
    at readableAddChunk (node:internal/streams/readable:349:9)
    at Readable.push (node:internal/streams/readable:286:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 103,
  severity: 'ERROR',
  code: '42701',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'tablecmds.c',
  line: '2406',
  routine: 'MergeAttributes'
}
[Nest] 16428  - 11/16/2023, 6:38:52 PM   ERROR [GlobalExceptionFilter] /* xc */
CREATE TABLE "nc_y35o___鍟嗗搧娓呭柈" ( "ID" bigint NOT NULL, "SKU" bool NULL DEFAULT false, "field" character varying NULL, "field" text NULL, "field" bigint NULL, "field" date NULL, "field" date NULL, "field" date NULL, "created_at" timestamp NULL DEFAULT now(), "updated_at" timestamp NULL DEFAULT now(), PRIMARY KEY("ID")); - column "field" specified more than once
error: /* xc */
CREATE TABLE "nc_y35o___鍟嗗搧娓呭柈" ( "ID" bigint NOT NULL, "SKU" bool NULL DEFAULT false, "field" character varying NULL, "field" text NULL, "field" bigint NULL, "field" date NULL, "field" date NULL, "field" date NULL, "created_at" timestamp NULL DEFAULT now(), "updated_at" timestamp NULL DEFAULT now(), PRIMARY KEY("ID")); - column "field" specified more than once
    at Parser.parseErrorMessage (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/Users/jaychung/Documents/Workspace/js/beru_whitesun_lars/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:514:28)
    at Socket.emit (node:domain:488:12)
    at addChunk (node:internal/streams/readable:376:12)
    at readableAddChunk (node:internal/streams/readable:349:9)
    at Readable.push (node:internal/streams/readable:286:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Desired Behavior

All data should imported correctly.

Project Details

Node: v20.9.0
Arch: x64
Platform: darwin
Docker: false
RootDB: pg
PackageVersion: 0.202.5

Attachments

CleanShot 2023-11-16 at 18 47 31

CleanShot 2023-11-16 at 18 43 48

CleanShot 2023-11-16 at 18 45 47

Excel file

test.xlsx

@wingkwong wingkwong added the 馃悰 Type: Bug Something is broken or incorrect unexpectedly. label Nov 16, 2023
@wingkwong wingkwong self-assigned this Nov 16, 2023
@dstala dstala added this to the v0.203.0 milestone Nov 17, 2023
@wingkwong
Copy link
Member

@xJkit in the next release, you can set NC_SANITIZE_COLUMN_NAME=false to support chinese words.

@xJkit
Copy link
Author

xJkit commented Nov 20, 2023

Thanks for your hard work.

@dstala dstala removed this from the vFeature milestone Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 Type: Bug Something is broken or incorrect unexpectedly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants