From 2849d50961eee2ffcef06874e61c0fa875837529 Mon Sep 17 00:00:00 2001 From: davidbenton Date: Thu, 30 May 2013 08:38:08 -0500 Subject: [PATCH] Parameterized hard-coded db name --- code/PostgreSQLDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/PostgreSQLDatabase.php b/code/PostgreSQLDatabase.php index d3147e4..75ad045 100644 --- a/code/PostgreSQLDatabase.php +++ b/code/PostgreSQLDatabase.php @@ -145,7 +145,7 @@ class PostgreSQLDatabase extends SS_Database { // First, we need to check that this database exists. To do this, we will connect to the 'postgres' database first // some setups prevent access to this database so set PostgreSQLDatabase::$check_database_exists = false if(self::$check_database_exists) { - $this->dbConn = pg_connect('host=' . $parameters['server'] . ' port=' . $port . ' dbname=postgres' . $username . $password); + $this->dbConn = pg_connect('host=' . $parameters['server'] . ' port=' . $port . ' dbname=' . $dbName . ' ' . $username . $password); if(!$this->dbConn) { throw new ErrorException("Couldn't connect to PostgreSQL database");