Re: Unhappy with error handling in psql's handleCopyOut() - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Unhappy with error handling in psql's handleCopyOut()
Date
Msg-id 20140212030024.GY2921@tamriel.snowman.net
Whole thread Raw
In response to Re: Unhappy with error handling in psql's handleCopyOut()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* 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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: truncating pg_multixact/members
Next
From: Peter Eisentraut
Date:
Subject: Re: improve the help message about psql -F