Re: Getting results after networking error - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Getting results after networking error
Date
Msg-id 16904.1123604812@sss.pgh.pa.us
Whole thread Raw
In response to Getting results after networking error  (jtv@xs4all.nl)
Responses Re: Getting results after networking error
List pgsql-interfaces
jtv@xs4all.nl writes:
> I sometimes issue multiple queries at once using semicolons, so one call
> returns multiple results.  Now let's say my network connection to the
> backend breaks and not all the results can be returned--I get a result
> with some error code (wish I knew which, but that's another story)
> followed by a NULL result to indicate that no more results are following,
> right?

> Now let's say that I issue my next query and the network connection
> recovers in the process.  I happily start retrieving results again, but
> are they only results for the new query, or do I go through the remaining
> results of the last query first?

I don't think there is a unique answer to that, without a whole lot of
assumptions about the nature of the failure and the behavior of the
network transport layer.  Did the backend see any send() failures?
Did the transport layer permanently lose any data already given to it,
or just delay transmission?

On the whole I think the odds of re-syncing successfully are pretty bad,
and you'd be best off to pull the plug and start a new connection if you
see any networking failure.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: jtv@xs4all.nl
Date:
Subject: Getting results after networking error
Next
From: David
Date:
Subject: Re: pgperl vs dbd-perl