im尝试创建一个批处理脚本以删除数据库并使用转储文件进行还原。 错误:“ dropdb:command0line参数过多(第一个是“ --dbname”) pg_restore:命令行参数太多(第一个是“ --dbname)”
set /p dir=Choose a directory: (HERE I WANT TO CHOOSE DUMP FILE TO RESTORE DATABASE)
cls
if exist %dir% (cd %dir%) else echo Directory not found. & goto start
F:\PostgreSQL\10\bin\dropdb.exe --host "localhost" --port "5432" --username "USER" --password "PASS" --dbname "DATABASE_NAME" -- section=pre-data --section=data --section=post-data --create --verbose
F:\PostgreSQL\10\bin\pg_restore.exe --host "localhost" --port "5432" --username "USER" --password "PASS" --dbname "DATABASE_NAME" -- section=pre-data --section=data --section=post-data --create --verbose "%dir%" >> F:\\BackupDB\\log_%date:~4,2%-%date:~7,2%-%date:~10,4%.txt'