A bug in DBD::Pg can cause it to loop infinitely or crash when ping() is called on a disconnected database handle. In the disconnect() method, DBD::Pg calls PQfinish() which closes the connection and *frees the memory for the handle*. Later, if I call ping() on the disconnected dbh, DBD::Pg passes the freed memory to PQexec(), which does any of a number of undesirable things.
What is the canonical solution here? It seems that perhaps DBD::Pg should set its cconnection to NULL upon disconnect and check for NULL before executing anything on the handle. Or, it seems as though DBI should not allow the ping() method to reach the DBD implementation when Active is false. -jwb