Re: csv copy error

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: csv copy error
Дата
Msg-id CAECtzeV3gs_Ga+XmRrPHCE98WQdYs51UUf2W5LEW17p5VDLNQg@mail.gmail.com
обсуждение исходный текст
Ответ на csv copy error  (ourdiaspora <ourdiaspora@protonmail.com>)
Ответы Re: csv copy error  (ourdiaspora <ourdiaspora@protonmail.com>)
Список pgsql-general
Hi,

Le mer. 29 déc. 2021 à 22:08, ourdiaspora <ourdiaspora@protonmail.com> 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Hasan Marzooq
Дата:
Сообщение: pg_config header files are missing - Postgres 13 - Amazon Linux 2
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_config header files are missing - Postgres 13 - Amazon Linux 2