postgresql restore from dump
psql -U postgres -h localhost -p 5432 -f data_dump.sql
postgres make sql dump
pg_dump -U username dbname > dbexport.pgsql
Source: www.a2hosting.in
backup postgres database
pg_dump -h localhost -U postgres -W -d mydb > mydb.sql
postgres backup of table
pg_dump --host localhost --port 5432 --username postgres --format plain --verbose --file "<abstract_file_path>" --table public.tablename dbname
Source: stackoverflow.com
How to backup databases using psql
pg_dump -U postgres mydb > mydb.sql