After using below the backup cmd in a db with 250+ tables:
pg_dump -h localhost -p portNum -U userName -f fileName -o dbName
I tried restoring it with the following command:
psql -h localhost -p portNum -U userName -d dbName -f fileName
While doing so many of the tables were having foreign key dependency, and hence only few tables got restored. How can I resolve the issue and restore complete database? Will turning off the foreign key constraint in postgres help me solve the issue. If so, how can I achieve this? What should I do to turn it off and turn it on after restoring?