From 0e8f16e1c64b07cf6d90264f8f754307d340b30e Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Thu, 3 Mar 2005 15:15:01 +0000 Subject: Bug 284172: checksetup cannot run CREATE DATABASE on PostgreSQL Patch By Max Kanat-Alexander r=glob, a=justdave --- Bugzilla/DB/Pg.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Bugzilla/DB/Pg.pm') diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index a23c38666..9766da383 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -47,12 +47,21 @@ use Carp; # This module extends the DB interface via inheritance use base qw(Bugzilla::DB); +use constant REQUIRED_VERSION => '7.02.0000'; +use constant PROGRAM_NAME => 'PostgreSQL'; + sub new { my ($class, $user, $pass, $host, $dbname, $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:host=$host;dbname=$dbname;port=$port"; - + my $dsn = "DBI:Pg:host=$host;dbname=$dbname"; + $dsn .= ";port=$port" if $port; + my $self = $class->db_new($dsn, $user, $pass); # all class local variables stored in DBI derived class needs to have -- cgit v1.2.3-24-g4f1b