bat文件中的内容:
PATH D:\Program Files\PostgreSQL\13\bin;D:\Program Files\7-Zip
set PGPASSWORD=****
pg_dump -h 8.134.151.187 -p 5466 -U sky -d mip_db --schema-only -f D:\DB\backup\%TODAY%-schema-mip_db_ali.sql
pg_dump -h 8.134.151.187 -p 5466 -U sky -d mip_db --format=c -f D:\DB\backup\%TODAY%-mip_db_ali.dump
CD /D D:\Program Files\PostgreSQL\13\bin
REM 设置本机的密码
set PGPASSWORD=****
pg_restore -h localhost -p 5432 -U sky -d mip_db "D:\DB\backup\%TODAY%-mip_db_ali.dump"
pause
查看-f参数的含义: