Skip site navigation (1) Skip section navigation (2)

perl, connect and timeout

From: Bill Carlson <wcarlson(at)kinzemfg(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: perl, connect and timeout
Date: 1998-02-27 23:52:37
Message-ID: Pine.LNX.3.95.980227173914.28331A-100000@wally.kinze.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hello,

I have a perl script that is giving me fits.

The basic system accesses postgres across a network. I am trying to code
for things like network failures, etc., basically if the backend is not
available or ready I need to process locally and in a hurry, so any delay
is not acceptable.

I am using the Pg module right now, I have looked at DBI, but would prefer
to use the Pg for now.

I am simulating the network failure by pulling the plug on the nic (worst
case scenario...:) )

$conn->status returns connection good after this (?), doing a $conn->reset
sends me into never-never land for a couple of minutes ( I assume this is
a timeout somewhere, is it adjustable at the frontend at runtime?)

I finally worked around that by using alarm(), but after getting to where
$conn->status does return CONNECTION_BAD, I have so far been unable to
reconnect to the backend!

Is there something I am missing? There has got to be a better way to do
what I need.
 

Any pointers appreciated!

Bill Carlson			|	Opinions expressed are my own
KINZE Manufacturing, Inc.	|	not my employer's.


pgsql-interfaces by date

Next:From: Constantin TeodorescuDate: 1998-02-28 14:39:24
Subject: PgAccess 0.80 is working good on postgreSQL 6.3 latest snapshot
Previous:From: Chihiro SakamakiDate: 1998-02-26 14:22:28
Subject: subscribe

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group