备份全部数据:

#cd /usr/local/pgsql/bin

/usr/local/pgsql/bin/pg_dumpall -U postgres > /root/pgall.sql

恢复全部数据:

/usr/local/pgsql/bin/psql -U postgres -f /root/pgall.sql

备份单个数据库

/usr/local/pgsql/bin/pg_dump -U postgres singel > /root/singel.sql

恢复:

/usr/local/pgsql/bin/psql -U postgres dbname < /root/singel.sql