先切换到postgres用户下:
su - postgres
备份:
pg_dump [database_name] > /home/postgres/db.dump -- 或者 db.sql
恢复:
psql [database_name] < /home/postgres/db.dump