pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitriy Chumack <saint@apriorit.com>
To: pgsql-interfaces@postgresql.org
Subject: libpq - check PGconn* - is it valid
Date: Wed, 11 Oct 2006 18:33:13 +0300
Message-ID: <95520488.20061011183313@apriorit.com> (raw)

Hi everyone.

I have such a problem. My application, some server, use libpq librarry
to interact with PostgreSQL-8.1.0 database. Postgresql server and my
server work on different computers in the local network. When my server
starts, it creates pool of 10 connections to database. My server use
PQexec() to submit queries to db. But when there is no network
connection to the database (I simply unplug the network cable from
computer on which PG server is run) and my server calls PQexec() -
than it hangs in PQexec() call. And it will hang there for a very
long time (I wait about 30 minutes and there is no result). And
when I plug in the network cable back, PQexec() remains hanging (I
wait about 10 minutes and there is no result too).

I use simply (not ssl) connection to db.

So how can I check PGconn pointer if it represent a health connection
to prevent my server to hang in PQexec() call?

Thanks in advance.
-- 
Best regards,
 Dmitriy Chumack                         mailto:saint@apriorit.com
Software Developer of ApriorIT





view thread (4+ messages)  latest in thread

Message-ID: <95520488.20061011183313@apriorit.com>
Permalink:  ../95520488.20061011183313@apriorit.com/
Also on:    postgresql.org/message-id/95520488.20061011183313@apriorit.com

 · 

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: saint@apriorit.com
  Subject: Re: libpq - check PGconn* - is it valid
  In-Reply-To: <95520488.20061011183313@apriorit.com>

* 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