Check a PostgresQL connection in ruby