How to Install PostgreSQL on Ubuntu Gutsy Gibbon (7.10)

2008 January 21
by Tzury Bar Yochay

Useful and simple guide, step by step.
http://www.supriyadisw.net/2007/02/postgresql-on-ubuntu-linux

Installing postgresql (8.2)

sudo apt-get install postgresql-8.2

Setting up the password for postgres’ postgres user

sudo -u postgres psql template1
ALTER USER postgres WITH PASSWORD 'your-password';
\q

Configure postgres’ authentication method :

sudo cp /etc/postgresql/8.2/main/pg_hba.conf /etc/postgresql/8.2/main/pg_hba.conf_bak
sudo nano /etc/postgresql/8.2/main/pg_hba.conf

Add the following at the bottom of the file

# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    all         all         127.0.0.1       255.255.255.0    password

Restart postgres:

sudo /etc/init.d/postgresql-8.2 restart
3 Responses leave one →
  1. 2008 March 3

    Quite goood article. Simple short straight to the point and most of all it actually works :-). Now it would be nice if you also mention about adding the current user as a power DB user so it wil just be good :-)
    something like
    sudo -i
    su postgres
    createuser

  2. 2008 July 12
    nanungnurzula permalink

    very very good

  3. 2009 February 2
    leo permalink

    awesome, works for 8.3 too if you replace 8.2 with the appropriate number :)

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS