postgres create database from dump code example
Example 1: postgres make sql dump
pg_dump -U username dbname > dbexport.pgsql
Example 2: populate db from command line postgres
\i 'path/to/file.sql'
pg_dump -U username dbname > dbexport.pgsql
\i 'path/to/file.sql'