diff options
-rw-r--r-- | Bugzilla/DB.pm | 1 | ||||
-rw-r--r-- | Bugzilla/DB/Pg.pm | 7 | ||||
-rw-r--r-- | docs/en/rst/installing/postgresql.rst | 14 | ||||
-rw-r--r-- | template/en/default/setup/strings.txt.pl | 1 |
4 files changed, 12 insertions, 11 deletions
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; diff --git a/docs/en/rst/installing/postgresql.rst b/docs/en/rst/installing/postgresql.rst index 8e8c4a08b..10455488c 100644 --- a/docs/en/rst/installing/postgresql.rst +++ b/docs/en/rst/installing/postgresql.rst @@ -14,8 +14,8 @@ server is started when the machine boots. .. _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 @@ -29,12 +29,18 @@ then switch to being the postgres (Unix) user: 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: diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl index 4b1bc873e..3adb06b85 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -141,6 +141,7 @@ END 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 |