postgresql相应的表备份语句

备份相应的表格
pg_dump -t st_passports -t sl_uploadedfiles -t sl_salarytypemap -t sl_salary_test -t sl_notices -t sl_ip_documents -t sl_departtypemap -t sl_budgetstate -t sl_budgetinfo -t sl_budgetdetail single_database > single_database.bak

恢复数据库
psql single_database < single_database.bak

备份单张表络
pg_dump -t sl_salarytypemap single_database > single_database.bak

备份相应的表格

pg_dump --host 172.30.7.56 --username "postgres" --format custom --blobs --clean -t '"T_CRS_ScheduleGameDate"' -t '"T_CRS_ScheduleDiscipline"' Game_TJ13 > "/data/service-data/ftp/Game_TJ13_日程表_app1.`date +%Y-%m-%d`.backup"

恢复数据库
pg_dump -t '"sl_budgetdetail"' single_database> "/home/appwork/single_database.`date +%Y-%m-%d`.backup"

备份单张表络
pg_dump -t '"sl_budgetdetail"' -t '"sl_budgetinfo"' -t '"sl_budgetstate"' -t '"sl_departtypemap"' -t '"sl_ip_documents"' -t '"sl_notices"' -t '"sl_salary_test"' -t '"sl_salary_test"' -t '"sl_salary_test"' -t '"sl_salary_test"' -t '"sl_salary_test"'single_database> "/home/appwork/single_database.`date +%Y-%m-%d`.backup"

猜你喜欢

转载自110shen110.iteye.com/blog/2405151