title: Restore PostgreSQL db from backup without foreign key constraint issue
body: <p>I have a postgresql db with about 85+ tables. I make backups regularly using <code>pg_dump</code> (via php-pgadmin) in copy mode and the size of the backup file is almost 10-12 MB. Now the problem I am facing is that whenever I try to restore the database, foreign key constraint problem occur. The scenario is as follows:</p>
  
  <p>There are two tables: 1) <code>users</code> and 2) <code>zones</code>. I have stored the id of zone in <code>users</code> table to identify the user's zone and have set it as foreign key.</p>
  
  <p>When I take the db dump, the entries for table <code>zones</code> come only after that of table <code>users</code>. I think it's due to the first letter of table name: <code>u</code> comes before <code>z</code>, and therefore when I restore the database, a foreign key constraint problem occurs and the execution stops. The same problem occurs when I try to restore the db structure, it says the table <code>zones</code> does not exist in the database since the structure of <code>zones</code> comes after that of <code>users</code> in the dump file.</p>
  
  <p>Is there any solution for this? Is there any other backup method feasible?</p>