dump sql file psql code example
Example 1: how to take database dump in postgresql
pg_dump dbname > outfile
Example 2: psql load dump
psql databasename < data_base_dump
pg_dump dbname > outfile
psql databasename < data_base_dump