Commit 873b952c authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #307 from antonioribeiro/patch-1

Postgres fix for a possible unavailable dbname
parents 163d5790 41b2325c
......@@ -65,6 +65,9 @@ class Driver implements \Doctrine\DBAL\Driver
public function getDatabase(\Doctrine\DBAL\Connection $conn)
{
$params = $conn->getParams();
return $params['dbname'];
return (isset($params['dbname']))
? $params['dbname']
: $conn->query('SELECT CURRENT_DATABASE()')->fetchColumn();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment