aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-05-21 23:02:12 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2012-05-21 23:02:12 -0400
commit9fa7ab62ad45abf3a5035cc792748893d6cd8a4d (patch)
tree65222eff56fbc72171a2f5b9bd8c57035de13296
parenta97ebe78bfddd1ec20903183087c20a936a96a23 (diff)
downloadforums-9fa7ab62ad45abf3a5035cc792748893d6cd8a4d.tar
forums-9fa7ab62ad45abf3a5035cc792748893d6cd8a4d.tar.gz
forums-9fa7ab62ad45abf3a5035cc792748893d6cd8a4d.tar.bz2
forums-9fa7ab62ad45abf3a5035cc792748893d6cd8a4d.tar.xz
forums-9fa7ab62ad45abf3a5035cc792748893d6cd8a4d.zip
[ticket/10828] Connect to postgres database by default.
When not connecting to a specific database, connect to postgres database which specifically exists as a default database to connect to. PHPBB3-10828
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index c734c90a1a..ae21be6c34 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -80,6 +80,21 @@ class phpbb_database_test_connection_manager
{
$dsn .= ';dbname=' . $this->config['dbname'];
}
+ else if ($this->dbms['PDO'] == 'pgsql')
+ {
+ // Postgres always connects to a
+ // database. If the database is not
+ // specified here, but the username
+ // is specified, then connection
+ // will be to the database named
+ // as the username.
+ //
+ // For greater compatibility, connect
+ // instead to postgres database which
+ // should always exist:
+ // http://www.postgresql.org/docs/9.0/static/manage-ag-templatedbs.html
+ $dsn .= ';dbname=postgres';
+ }
break;
}