Re: Getting results after networking error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jtv(at)xs4all(dot)nl
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Getting results after networking error
Date: 2005-08-09 16:26:52
Message-ID: 16904.1123604812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

jtv(at)xs4all(dot)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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message joshua masiko 2005-08-09 19:40:27 BUG #1815: ECPGdebug causes crash on Windows XP
Previous Message David 2005-08-09 16:10:24 Re: pgperl vs dbd-perl