Check out example codes for "access the postgres psql". It will help you in understanding the concepts better.

Code Example 1

psql -h localhost -U username databasename

Learn ReactJs, React Native from akashmittal.com