Re: \copy command - Mailing list pgsql-novice

From Tom Lane
Subject Re: \copy command
Date
Msg-id 29848.1053119497@sss.pgh.pa.us
Whole thread Raw
In response to \copy command  (dario billo <dario.billo@inwind.it>)
List pgsql-novice
dario billo <dario.billo@inwind.it> writes:
> \.
> ": can't parse "ne 1, pg_atoi: error in "
> lost synchronization with server, resetting connection

Given the funny formatting of the error message, I'd bet you have a
newline problem.  COPY does not like anything but Unix-style newlines
(\n only); feeding it Windows-style newlines (\r\n) will lead to
failures like the above.

> why "resetting connection"?

Because there is no other way to recover from a COPY error in the
current FE/BE protocol.  (7.4 will improve that situation, but it
will require client-side rewrites to take advantage of the new
protocol...)

            regards, tom lane

pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: Re: Insert on create table
Next
From: Matej Cepl
Date:
Subject: Re: Problems with join (no such attribute, but it exists)