Steps to install postgresql
Install PostgreSQL and its libraries
sudo apt-get install postgresql postgresql-contrib libpq-dev
After the installation create a user for postgresql
sudo -u postgres createuser --superuser $USER
or
sudo -u postgres createuser pgs_root
Set user password for the postgresql user
sudo -u postgres psql postgres --set "user=$USER"
postgres=# \passsword :user
or
sudo -u postgres psql postgres
postgres=# \passsword pgs_root
Configure the postgresql.conf file to make PostgreSQL listen to localhost or listen on an external IP or something, change this line to either the IP or 'localhost'
gedit /etc/postgresql/8.4/main/postgresql.conf listen_addresses = 'localhost'
Like mysql query browser, there is a GUI for postgresql called pgadmin. To install run this command
sudo apt-get install pgadmin3