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

From jtv@xs4all.nl
Subject Re: Getting results after networking error
Date
Msg-id 17553.202.47.227.25.1123645908.squirrel@202.47.227.25
Whole thread Raw
In response to Re: Getting results after networking error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
Tom Lane wrote:

> I think that a reasonable API for this "if PQstatus(conn) is
> CONNECTION_BAD then you had a networking problem".  I am not at all sure
> how well libpq honors that definition currently ... but feel free to
> send patches ;-)

As I posted in July,

  http://archives.postgresql.org/pgsql-interfaces/2005-07/msg00003.php

the current situation is that libpq goes out of its way to maintain
CONNECTION_OK in these cases.  I'd still like to see the fix I outlined
there, which is to treat socket errors as fatal by default (apart from the
special cases for EAGAIN, EINTR and friends that are already there, of
course).

I'm attaching a patch; something similar may be called for in pqSendSome()
as well.  A next step would be to factor the code duplication out of the
function, eliminating the redundant error message in the process.


Jeroen

Attachment

pgsql-interfaces by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: pgperl vs dbd-perl
Next
From: "Johan C. de Koning"
Date:
Subject: Getting oid with libpq