You can use the -c (--clean) option while pg_dump is running, so the dump will contain the correct DROP commands ...
But overall, I would suggest going the "hard way":
dropdb ...
createdb ...
psql -d ... -f dump.file
Thus, you are sure that there are no "left frames" from what was previously in the database.
user80168
source
share