Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv - Mailing list pgsql-general

From John R Pierce
Subject Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv
Date
Msg-id 4e8d2f31-d723-09cf-e160-d9570a6627d5@hogranch.com
Whole thread Raw
In response to [GENERAL] COPY ... FROM stdin WITH FORMAT csv  (Alexander Farber <alexander.farber@gmail.com>)
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv
Next
From: Francisco Olarte
Date:
Subject: Re: [GENERAL] COPY ... FROM stdin WITH FORMAT csv