csv copy error

From: ourdiaspora <ourdiaspora(at)protonmail(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: csv copy error
Date: 2021-12-29 21:08:21
Message-ID: AynaFreTKFW66TSpzETbKjQGqJrUVuTJdYY5biXVSBBU6CUlfuarEqgxekzJ5aSgIWJS6stp5R0pIg1lR19cM0RXEDEHlzQ87UioKnjxS1s=@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Readers,

Please could anyone help with the following error produced:

"
ERROR: invalid input syntax for integer: "1,m "
CONTEXT: COPY exampletable, line 1, column examplenumber: "1,m "

The database commands:

"
CREATE TABLE exampletable (examplenumber smallint,
exampletitle varchar(500)
);
"

"
\copy exampletable from '/local/path/to/examplefile.csv';
"

CSV file contents:

"
1,m
2,m
9,t
"

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-12-29 21:15:54 Re: csv copy error
Previous Message Alan Hodgson 2021-12-29 18:36:43 Re: Find missing data in a column