#542426 by neilnz: PostgreSQL should not require password to be set in settings.php for trust mode.

merge-requests/26/head
Angie Byron 2009-08-19 08:12:26 +00:00
parent 38abc06534
commit 0ae93f0cb4
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,11 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
$connection_options['port'] = 5432;
}
// PostgreSQL in trust mode doesn't require a password to be supplied.
if (empty($connection_options['password'])) {
$connection_options['password'] = null;
}
$dsn = 'pgsql:host=' . $connection_options['host'] . ' dbname=' . $connection_options['database'] . ' port=' . $connection_options['port'];
parent::__construct($dsn, $connection_options['username'], $connection_options['password'], array(
// Convert numeric values to strings when fetching.