X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 214039DCA36 for ; Wed, 14 Dec 2005 22:13:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57731-09 for ; Wed, 14 Dec 2005 22:13:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp-vbr15.xs4all.nl (smtp-vbr15.xs4all.nl [194.109.24.35]) by postgresql.org (Postfix) with ESMTP id 452BC9DCA35 for ; Wed, 14 Dec 2005 22:13:00 -0400 (AST) Received: from webmail.xs4all.nl (dovemail3.xs4all.nl [194.109.26.5]) by smtp-vbr15.xs4all.nl (8.13.3/8.13.3) with ESMTP id jBF2D18q053166; Thu, 15 Dec 2005 03:13:02 +0100 (CET) (envelope-from jtv@xs4all.nl) Received: from 202.47.247.130 (SquirrelMail authenticated user jtv) by webmail.xs4all.nl with HTTP; Thu, 15 Dec 2005 09:13:02 +0700 (ICT) Message-ID: <21828.202.47.247.130.1134612782.squirrel@webmail.xs4all.nl> In-Reply-To: <43A0A212.2070202@cognitronics.com> References: <43A0A212.2070202@cognitronics.com> Date: Thu, 15 Dec 2005 09:13:02 +0700 (ICT) Subject: Re: Dropped conection from libpq PGconn From: "Jeroen T. Vermeulen" To: "Kashyap Jani" Cc: pgsql-interfaces@postgresql.org User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/21 X-Sequence-Number: 5889 On Thu, December 15, 2005 05:52, Kashyap Jani wrote: > I was wondering why does PGconn object keeps saying the connection > is OK if I lost my Ethernet connection to the box where my database is > running ? > If that's the case does any one know how to check if my connection > objects are not valid anymore without using PGReset function call. First of all, the change in status will probably only be noticed if you actually try to use the connection and it fails. This in turn may take a very long time to time out if the physical connection is not there; you may try looking for system-specific settings that can make your OS give up on the connection more easily, but by nature it has to keep retrying for as long as it can. Finally, there used to be a bug in libpq where, even though PGresults would come back with error codes when the connection broke with certain errors (including connection timeout), it would fail to mark a connection error in the PGconn. This was fixed just a few months ago; the libpq in 8.1 should have the patch IIRC. Here is some discussion on that: http://svr5.postgresql.org/pgsql-interfaces/2005-07/msg00003.php Jeroen