Re: [GENERAL] How to "ping" the database

2005-08-17 Thread Tom Lane
Bill Moseley <[EMAIL PROTECTED]> 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

Re: [GENERAL] How to "ping" the database

2005-08-17 Thread Bill Moseley
On Wed, Aug 17, 2005 at 04:25:48PM -0400, Tom Lane wrote: > 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. Well, there's that. I'm not really

[GENERAL] How to "ping" the database

2005-08-17 Thread Bill Moseley
The Perl DBI interface to Postgresql, module DBD::Pg, has a ping() method that is suppose to determine if a database connection is alive. It can be seen here (see: dbd_db_ping): http://search.cpan.org/src/DBDPG/DBD-Pg-1.43/dbdimp.c It pings by calling: status = _result(imp_dbh, "SELEC