Bug 284172: checksetup cannot run CREATE DATABASE on PostgreSQL

Patch By Max Kanat-Alexander <mkanat@kerio.com> r=glob, a=justdave


git-svn-id: svn://10.0.0.236/trunk@170127 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%kerio.com
2005-03-03 07:15:03 +00:00
parent a5d878e57e
commit 2943ee11e1
5 changed files with 85 additions and 45 deletions

View File

@@ -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