pg_dump is an effective tool for PostgreSQL through which we can backup postgres database and to restore PostgreSQL database, command psql is enough.
1) backup postgres database
Ssh to server and execute following command to take backup of database.
#pg_dump -U Db_User Db_name -f database_name.sql
Executing above command will prompt you for database password, once password is authenticated database will be backup into file database_name.sqlNote: replace Db_User and Db_name with your actual database user and database name respectively.
2) Restore postgres database
#psql -U Db_user -d Db_name -f mydb.sql
contact@webhostingsupport.info

1 comment
vibhor Kumar says:
August 17, 2010 at 3:27 PM (UTC 5.5 )
pg_dump command would help you take the backup as snapshot of data in PostgreSQL for one particular moment.
However, when it comes production system, where user cannot afford to loss data, Hotbackup of PostgreSQL is recommended.
Following is a link for Hotbackup of Postgresql DB:
http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html