3.6.2. PostgreSQL

Test which version of PostgreSQL you have installed with:

psql -V

You need PostgreSQL version 9.0 or higher.

If you install PostgreSQL manually rather than from a package, make sure the server is started when the machine boots. 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 assume the defaults in localconfig; if you changed those, you need to modify the commands appropriately.

On most systems, to create a user in PostgreSQL, login as the root user, and then switch to being the postgres (Unix) user:

su - postgres

As the postgres user, you then need to create a new user:

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) or create databases (-D).

Next we will create a database for bugzilla to use

createdb -U postgres -O bugs bugs

This will create a database named bugs that is owned (-O) by the bugs user. Permit Access

Edit the file pg_hba.conf which is usually located in /var/lib/pgsql/data/. In this file, you will need to add a new line to it as follows:

host   all    bugs  md5

This means that for TCP/IP (host) connections, allow connections from '' to 'all' databases on this server from the 'bugs' user, and use password authentication ('md5') for that user.

Now, you will need to stop and start PostgreSQL fully. (Do not use any 'restart' command, due to the possibility of a change to postgresql.conf.)