how to install postgresql for ubuntu

type terminal

sudo add-apt-repository ppa:pitti/postgresql

sudo apt-get update

sudo apt-get install postgresql

sudo apt-get install pgadmin3

finally, to test this type

pgadmin3

enjoy this.