Export a postgresql database
pg_dump -c -h $host -p $port -U $user --password -d $db_name > exported_db.sql
Flags:
- -c: drop and recreate existing objects, when importing into an other postgres instance
Import a postgresql database
psql -h $host -p $port -U $user --password -d $db_name < exported_db.sql