Setup Postgres for Jenkins
sudo -u postgres psql -c "CREATE ROLE jenkins WITH SUPERUSER LOGIN;"
sudo -u postgres psql -c "ALTER ROLE jenkins WITH CREATEDB;"
Modify the postgres pg_hba.conf to enable trusted local authentication for the jenkins user:
echo "local all jenkins trust" | sudo tee --append /etc/postgresql/9.1/main/pg_hba.conf
Restart postgres
sudo /etc/init.d/postgresql restart