How to Compile and Install PostgreSQL 9 Beta on Ubuntu 3

Posted by John Wulff Tue, 04 May 2010 18:56:00 GMT

Started with totally fresh 64 bit Ubuntu 10.04 Server install.

sudo apt-get install build-essential libreadline6-dev zlib1g-dev
wget http://wwwmaster.postgresql.org/redir/333/h/source/v9.0beta1/postgresql-9.0beta1.tar.gz
tar zxvf postgresql-9.0beta1.tar.gz
cd postgresql-9.0beta1
./configure
make
sudo make install

Add PATH="$PATH:/usr/local/pgsql/bin" to the end of /etc/profile

source /etc/profile
sudo adduser postgres
sudo mkdir /usr/local/pgsql/data
sudo chown postgres /usr/local/pgsql/data
sudo su postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data
exit
psql -U postgres

Comments

Leave a comment

  1. Avatar
    FTFY 19 days later:
    > sudo make install

    sudo checkinstall

  2. Avatar
    Ferdy 3 months later:
    PATH in /etc/profile should better read as follows: export PATH="/usr/local/pgsql/bin:${PATH}" This will always result in using the 9.0 psql, createdb,... commands instead of may be older versions installed on the systems. If you don't want it installed system-wide, use the above line in your home bashrc: ~/.bashrc.
  3. Avatar
    exchange rate 4 months later:
    Thanks for this great tip.Many thanks!
Comments