备份数据库:
pg_dump -h localhost -U root db > /home/{user}/dumps/db_20220720.bak
恢复数据库:
psql -h localhost -U root -d db2 < /home/dumps/db_20220720.bak
备份表:
pg_dump -h localhost -U root db -t table > /home/dumps/db_table_20220720.bak
恢复表:
psql -h localhost -U root -d db2 -t table < /home/dumps/db_table_20220720.bak