Postgres 9.x installation in Ubuntu
Up to and including Ubuntu 10.10 Postgres version 9 is not supported/offered in the repositories.
[fleXive] however works fine with Postgres 9 and it is the recommended Postgres version to use.
Open a terminal console and switch to root (sudo -s) and the enter the following commands:
add-apt-repository ppa:pitti/postgresql
sudo apt-get remove postgresql-8.4 postgresql-client-8.4 postgresql-common pgadmin3 pgadmin3-data
sudo apt-get install postgresql-9.0 postgresql-client-9.0
Now change the postgres user password (still running as root):
su postgres
psql -d postgres -U postgres
In the psql shell enter:
alter user postgres with password 'a';
\q
You should now be ready to use Postgres 9 
If you need pgAdmin (which does currently not support prebuilt ubuntu packages) you'll have to compile and install it by hand:
First, create a source directory and grab the tarball (adjust version if needed):
wget http:tar xvfz pgadmin3-1.12.1.tar.gz
cd pgadmin3-1.12.1
./configure
make
sudo make install
configure will most likely complain about a missing pg_config.
To fetch it and grab other possible missing dependencies, open a terminal console and type:
sudo apt-get install postgresql-server-dev-9.0 libwxbase2.8-0 libwxbase2.8-dev libxml2 libxml2-dev libxml2-utils libxslt1.1 libxslt1-dev
Upgrading to Ubuntu 10.10
Make sure to re-enable the repository ppa:pitti/postgresql as the upgrade process will disable it.
In case you get errors when starting postgres complaining about SHMMAX add a file /etc/sysctl.d/90-postgres.conf containing:
Or adjust to a size until everything is working fine again.
See this bug
for further information.
I am trying to install pgadmin3 on an ubuntu lucid client without installing the server. I already have a postgresql 9 server up and running that I need to work with. The install fails because the server is not present. Is there another way to install just pgadmin3 from the tar on ubuntu 10.4 lucid?
I dont think so as the build process needs access to some libs from the server
Great Man! Solved my problem!
Also had to add libwxgtk2.8-dev in order to compile pgadmin (on Mint 11)
Great article, thank you again for wtiring.