restore postgresql from .sql code example
Example 1: postgresql restore from dump
psql -U postgres -h localhost -p 5432 -f data_dump.sql
Example 2: populate db from command line postgres
\i 'path/to/file.sql'
psql -U postgres -h localhost -p 5432 -f data_dump.sql
\i 'path/to/file.sql'