From 0ae93f0cb48f320d487deb4518d626a179777b0d Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 19 Aug 2009 08:12:26 +0000 Subject: [PATCH] #542426 by neilnz: PostgreSQL should not require password to be set in settings.php for trust mode. --- includes/database/pgsql/database.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc index 0f5627c2a28..ec68c3a396a 100644 --- a/includes/database/pgsql/database.inc +++ b/includes/database/pgsql/database.inc @@ -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.