Check out example codes for "stpop start psql server". It will help you in understanding the concepts better.

Code Example 1

sudo service postgresql start
sudo service postgresql stop
sudo service postgresql restart

Learn ReactJs, React Native from akashmittal.com