* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> I was able to reproduce this misbehavior by setting a gdb breakpoint
> at pqReadData and then killing the connected server process while psql's
> COPY IN was stopped there. Resetting outCount to zero in the
> socket-already-gone case in pqSendSome is enough to fix the problem.
> However, I think it's also prudent to hack PQgetResult so that it
> won't return a "copy in progress" status if the connection is known
> dead.
Agreed.
> The error recovery behavior in pqSendSome has been like this since 8.1
> or thereabouts, so I'm inclined to push something like the attached into
> all branches.
Looks good to me, thanks for running this down!
Stephen