Check out example codes for "how to run postgresql in linux". It will help you in understanding the concepts better.

Code Example 1

sudo service postgresql-9.3 initdb

Code Example 2

sudo service postgresql-9.3 start

Code Example 3

sudo service postgresql-9.3 initdb
sudo service postgresql-9.3 start

Learn ReactJs, React Native from akashmittal.com