restore db from backup postgres code example
Example 1: postgresql restore from dump
psql -U postgres -h localhost -p 5432 -f data_dump.sql
Example 2: restore postgres database from sql file
psql -d database_name -f backup.sql
psql -U postgres -h localhost -p 5432 -f data_dump.sql
psql -d database_name -f backup.sql