Denis Perchine <dyp@perchine.com> writes:
>>>> Looks much more reasonable. But I do not get messages about shutdown.
>>>> With a patch enclosed it will perform like with ECONNRESET.
>>>> Shouldn't I emulate EOF when EPIPE?
>>
>> You *are* emulating EOF --- with that check in place, pqReadData
>> should respond to EPIPE just like it does to a normal EOF. I don't
>> understand why you aren't seeing the same results I do.
> Hmmm... Looks like I get EPIPE just after connection reset, but you are able
> to read the rest of the data... Looks like Linux kernel problem again...
Ooh, you mean it doesn't give you the rest of the data before reporting
EPIPE? That seems so broken it's hard to believe --- a whole lot of
programs would be falling over, not just Postgres. There's probably
something else happening here, but I'm not real sure what. Might be
worth checking to see exactly what's in libpq's input buffer at the
time it sees the EPIPE error.
regards, tom lane