Backup and Restore a PostgreSQL DB

Back up a database
pg_dump database_name > outfile

Back up a database and remove ownership from tables etc.
pg_dump -O -U user_name database_name > outfile

Restore a database (create new database and read in tables)
createdb -U user_name new_database_name
psql -U user_name -f infile new_database_name