Re: How to "ping" the database - Mailing list pgsql-general

From Tom Lane
Subject Re: How to "ping" the database
Date
Msg-id 7581.1124310348@sss.pgh.pa.us
Whole thread Raw
In response to How to "ping" the database  (Bill Moseley <moseley@hank.org>)
List pgsql-general
Bill Moseley <moseley@hank.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

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Finding nearest numeric value
Next
From: Bruce Momjian
Date:
Subject: Re: COMMIT in ps output