Search Postgresql Archives

Re: csv copy error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Le mer. 29 déc. 2021 à 22:08, ourdiaspora <ourdiaspora@xxxxxxxxxxxxxx> a écrit :
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
"


You should tell the CSV command you're using a CSV file. By default, COPY thinks it's a TSV file.


--
Guillaume.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux