Skip to content

Commit

Permalink
template1 as default database for Postgres
Browse files Browse the repository at this point in the history
Fixes #402 (doctrine/DoctrineBundle#402) by connecting by default to 'template1' instead of the database with the same name as the user (Postgre default in case of no dbname).
  • Loading branch information
Paul dG authored and deeky666 committed Apr 30, 2015
1 parent 49dfdab commit 4ebd411
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ private function _constructPdoDsn(array $params)
if (isset($params['dbname'])) {
$dsn .= 'dbname=' . $params['dbname'] . ' ';
}
else {
$dsn .= 'dbname=template1' . ' ';
}

return $dsn;
}
Expand Down

0 comments on commit 4ebd411

Please sign in to comment.