Check out example codes for "restore postgres database from sql file". It will help you in understanding the concepts better.

Code Example 1

psql -U postgres -h localhost -p 5432 -f data_dump.sql

Code Example 2

psql -d database_name -f backup.sql

Learn ReactJs, React Native from akashmittal.com