test the database connection before trying to determine the installed PostGIS version