The contents of the error message are:

conn->errorMessage.data	0x00312440 "pqFlush() --  couldn't send data:
errno=0
No error A non-blocking socket operation could not be completed
immediately.

for this:

          if (PQputline(conn, pszBCPdata[i++]) == EOF)
			  printf("Error inserting data on row %d\n",
i-1);

What is the correct recovery action?  Do I send the same buffer again?

Fri, 17 May 2002 16:00:18 -0700
"Dann Corbit" <DCorbit@connx.com>
Error on PQputline()
"Dann Corbit" <DCorbit@connx.com> writes:
> The contents of the error message are:
> conn->errorMessage.data	0x00312440 "pqFlush() --  couldn't send data:
> errno=0
> No error A non-blocking socket operation could not be completed
> immediately.

You're running libpq with the nonblocking mode selected?

> What is the correct recovery action?

Redesign libpq's nonblock mode :-(.  It's a mess; a quick hack that
doesn't even try to cover all cases, and is unreliable in the ones it
does cover.  You can find my previous rants on the subject in the
archives from a couple years back (around Jan '00 I believe).  IMHO
we should never have accepted that patch at all.

Short of that, don't use the COPY code with nonblock.

			regards, tom lane

Fri, 17 May 2002 19:10:04 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Error on PQputline() 