my ($sql_server) = @_;
my $dbh;
my %connect_params = %{ Bugzilla->localconfig };
- $connect_params{db_name} = '';
my $conn_success = eval {
$dbh = _connect(\%connect_params);
};
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;
.. _posgresql-add-user:
-Add a User
-==========
+Add a User and Create a DB
+==========================
You need to add a new user to PostgreSQL for the Bugzilla
application to use when accessing the database. The following instructions
As the postgres user, you then need to create a new user:
-:command:`createuser -U postgres -dRSP bugs`
+:command:`createuser -U postgres -DRSP bugs`
When asked for a password, provide one and write it down for later reference.
The created user will not be a superuser (-S) and will not be able to create
-new users (-R). He will only have the ability to create databases (-d).
+new users (-R) or create databases (-D).
+
+Next we will create a database for bugzilla to use
+
+:command:`createdb -U postgress -O bugs bugs`
+
+This will create a database named `bugs` that is owned (-O) by the `bugs` user.
.. _postgresql-access:
localconfig_db_name => <<'END',
The name of the database. For Oracle, this is the database's SID. For
SQLite, this is a name (or path) for the DB file.
+For postgres, this database must already exist and be writable by $db_user.
END
localconfig_db_pass => <<'END',
Enter your database password here. It's normally advisable to specify