This is a step-by-step supplement guide for setting up your PostgreSQL database for JIRA on Ubuntu. However, the various procedures described below can be adapted (or may be applicable) to other Linux distributions too.
Set up PostgreSQL and create a user
PostgreSQL is very easy to set up on Ubuntu:
user:~$ sudo apt-get install postgresql-8.4 postgresql-client-8.4
Reading package lists... Done
Building dependency tree
* Starting PostgreSQL 8.2 database server [ OK ]
user:~$ sudo su - postgres
postgres:~$ createuser -P jira
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
Connect and set up a PostgreSQL database
We can now connect as our jira user and create a database.