Re: How to "ping" the database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bill Moseley <moseley(at)hank(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to "ping" the database
Date: 2005-08-17 20:25:48
Message-ID: 7581.1124310348@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bill Moseley <moseley(at)hank(dot)org> writes:
> I'm about to post a bug report on DBD::Pg, but I'm wondering if anyone
> here could suggest a better way to implement ping() that doesn't fail
> just because Postgresql is not allowing SELECTS.

I think you could just send an empty query string and see if anything
comes back.

Of course, this begs the question of what ping is really supposed to
test and when it's supposed to be allowable. The above will not work
if in the middle of retrieving a query result, for example.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2005-08-17 20:28:49 Re: speeding up a query on a large table
Previous Message Bruno Wolff III 2005-08-17 20:24:58 Re: Field order