Re: libpq ::PQstatus()

From: Einar Karttunen <ekarttun(at)cs(dot)Helsinki(dot)FI>
To: Zuev Dmitry <envoy1(at)chat(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: libpq ::PQstatus()
Date: 2001-08-20 18:22:55
Message-ID: 20010820212255.B10587@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 15, 2001 at 06:37:53PM +0600, Zuev Dmitry wrote:
> can anybody tell me why PQstatus() return not realy status ?
> i make a connection, then PQstatus() tell ok
> i stop database and PQstatus() tell me ok again (((
> is where method for get real status of connection ?
>
PQstatus checks whether the last thing returned by db was ok,
not whether the db is still alive. I suggest using some
dummy query like:
PQexec('SELECT 1;');

- Einar Karttunen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Einar Karttunen 2001-08-20 18:24:56 Re: Re: Perfomance decreasing
Previous Message Lamar Owen 2001-08-20 18:22:42 Re: New RPMS ?