PostgreSQL Dump Restore (pg_dump)

dump

pg_dump -U username databasename > databasefile

restore

pg_dump -U username databasename < databasefile