From 5880669daea07f078e2bd9deb6e1a0793f6a929f Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Fri, 8 Jul 2016 12:59:29 -0400 Subject: Bug 542507 - [PostgreSQL] The db_user sometimes cannot connect to the "template1" database --- Bugzilla/DB.pm | 1 - Bugzilla/DB/Pg.pm | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 6832e0ce7..68582305f 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -247,7 +247,6 @@ sub _get_no_db_connection { my ($sql_server) = @_; my $dbh; my %connect_params = %{ Bugzilla->localconfig }; - $connect_params{db_name} = ''; my $conn_success = eval { $dbh = _connect(\%connect_params); }; diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index 9ef7f77f1..ed1a4aa7d 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -36,14 +36,9 @@ use constant BLOB_TYPE => { pg_type => DBD::Pg::PG_BYTEA }; sub new { my ($class, $params) = @_; - my ($user, $pass, $host, $dbname, $port) = + my ($user, $pass, $host, $dbname, $port) = @$params{qw(db_user db_pass db_host db_name db_port)}; - # The default database name for PostgreSQL. We have - # to connect to SOME database, even if we have - # no $dbname parameter. - $dbname ||= 'template1'; - # construct the DSN from the parameters we got my $dsn = "dbi:Pg:dbname=$dbname"; $dsn .= ";host=$host" if $host; -- cgit v1.2.3-24-g4f1b