pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jtv@xs4all.nl
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Getting results after networking error
Date: Wed, 10 Aug 2005 04:24:39 +0200 (CEST)
Message-ID: <6201.202.47.227.25.1123640679.squirrel@202.47.227.25> (raw)
In-Reply-To: <16904.1123604812@sss.pgh.pa.us>
References: <4395.210.86.147.191.1123600604.squirrel@210.86.147.191>
	<16904.1123604812@sss.pgh.pa.us>

Tom Lane wrote:

>> 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?

Well, I'm sort of assuming that if some data was actually lost, libpq
would call that a synchronization error and give up on the connection.  So
I'm talking specifically about the case where no data was lost, but an
error was returned by the network stack and the error later went away.


> 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.

I guess that makes sense.  But how do I know that the failure is a
networking failure and not, say, an SQL-level failure?  In my program, I
mean, without human intervention?


Jeroen





view thread (5+ messages)  latest in thread

Message-ID: <6201.202.47.227.25.1123640679.squirrel@202.47.227.25>
Permalink:  ../6201.202.47.227.25.1123640679.squirrel@202.47.227.25/
Also on:    postgresql.org/message-id/6201.202.47.227.25.1123640679.squirrel@202.47.227.25

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jtv@xs4all.nl, tgl@sss.pgh.pa.us
  Subject: Re: Getting results after networking error
  In-Reply-To: <6201.202.47.227.25.1123640679.squirrel@202.47.227.25>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox