Bash script to drop, create and upload data into a PostgreSQL DB

I write and do most of my preliminary testing for GovCheck on my MacBook. This means that whenever I play around with the database (like add columns to a table, delete columns or add/delete/edit data) I have to go and import a backup from the production server to get it back to a clean state. I used to have to run individual commands for this whole process (drop, create and insert data into the new db) which meant scouring through history to find the right commands etc. So yesterday I went ahead and wrote a bash script to do this for me.
 

 
You just need to set the PGPASSWD variable to your database's password and it should be good to go. Of-course, the script assumes that all you PostgreSQL binaries are in /usr/local/pgsql/bin and that the user you're using is postgres (using md5 authentication). You should change these if they don't match your setup. Other than that, this works like a charm for me.