Commit d99bc394 authored by Kim Hemsø Rasmussen's avatar Kim Hemsø Rasmussen

Stop using template1 as default database for postgres drivers

parent fbd6ab25
...@@ -90,9 +90,9 @@ class Driver extends AbstractPostgreSQLDriver ...@@ -90,9 +90,9 @@ class Driver extends AbstractPostgreSQLDriver
$dsn .= 'dbname=' . $params['dbname'] . ' '; $dsn .= 'dbname=' . $params['dbname'] . ' ';
} else { } else {
// Used for temporary connections to allow operations like dropping the database currently connected to. // Used for temporary connections to allow operations like dropping the database currently connected to.
// Connecting without an explicit database does not work, therefore "template1" database is used // Connecting without an explicit database does not work, therefore "postgres" database is used
// as it is certainly present in every server setup. // as it is certainly present in every server setup.
$dsn .= 'dbname=template1' . ' '; $dsn .= 'dbname=postgres' . ' ';
} }
if (isset($params['sslmode'])) { if (isset($params['sslmode'])) {
......
...@@ -33,6 +33,6 @@ class DriverTest extends AbstractDriverTest ...@@ -33,6 +33,6 @@ class DriverTest extends AbstractDriverTest
*/ */
protected function getDatabaseNameForConnectionWithoutDatabaseNameParameter() protected function getDatabaseNameForConnectionWithoutDatabaseNameParameter()
{ {
return 'template1'; return 'postgres';
} }
} }
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