Following ae the steps i followed to uninstall and reinstall. Which worked for me.
First remove the installed postgres :-
sudo apt-get purge postgr*
sudo apt-get autoremove
Then install 'synaptic':
sudo apt-get install synaptic
sudo apt-get update
Then install postgres
sudo apt-get install postgresql postgresql-contrib