Check out example codes for "désinstaller postgresql linux". It will help you in understanding the concepts better.

Code Example 1

sudo aptitude purge postgresql postgresql-common
sudo dpkg -P postgresql-8.4

sudo find / -name postgresql -exec rm -Rf {} \;
sudo find / -name pgsql -exec rm -Rf {} \;
sudo find / -name psql -exec rm -Rf {} \;

sudo userdel postgres

Learn ReactJs, React Native from akashmittal.com