Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv
Дата
Msg-id 4e8d2f31-d723-09cf-e160-d9570a6627d5@hogranch.com
обсуждение исходный текст
Ответ на [GENERAL] COPY ... FROM stdin WITH FORMAT csv  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
On 3/21/2017 10:31 AM, Alexander Farber wrote:
> words=> COPY words_reviews (uid, author, nice, review, updated) FROM
> stdin WITH FORMAT 'csv';
> ERROR:  syntax error at or near "FORMAT"
> LINE 1: ...d, author, nice, review, updated) FROM stdin WITH FORMAT 'cs...

its just csv, not 'csv' ...

> And I have tried adding/removing commas at the end of lines too.

if its getting a syntax error on the COPY command, its not yet read the
data...

note that COPY .... FROM STDIN  doesn't actually read from stdin, it
requires the data to be passed through to it with a special API
(PQputCopyData() in libpq, or similar in other APIs).   you can use
\copy in psql to stream the data from the same input.




--
john r pierce, recycling bits in santa cruz



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv