备份和恢复一个数据库
pg_dump dbname > outfile psql dbname < infile
备份和恢复整个数据库集群
pg_dumpall > outfile psql -f infile postgres
http://www.php100.com/manual/PostgreSQL8/backup.html