Check out example codes for "postgres make sql dump". It will help you in understanding the concepts better.

Code Example 1

pg_dump dbname > outfile

Code Example 2

psql databasename < data_base_dump

Code Example 3

pg_dump -U username dbname > dbexport.pgsql

Learn ReactJs, React Native from akashmittal.com