Check out example codes for "postgresql backup and restore globals and data". It will help you in understanding the concepts better.

Code Example 1

$ psql -U postgres -h localhost -p 5433 < globals.sql
$ psql -U postgres -h localhost -p 5433 < sandbox.sql

Code Example 2

$ pg_dump -U postgres -h localhost -p 5433 --clean --file=sandbox.sql sandbox
$ pg_dumpall -U postgres -h localhost -p 5433 --clean --globals-only --file=globals.sql

Learn ReactJs, React Native from akashmittal.com