The following Windows batch script fails on the line with database restore:
@Echo off set Path=C:\Program Files (x86) set Backup_Path=C:\Program Files (x86) c: cd \ cd C:\Program Files (x86)\PostgreSQL\9.1\bin @echo "Wait ..." setlocal set PGPASSWORD=1234 psql.exe -U postgres -c "create database Mydata" "C:\Program Files (x86)\PostgreSQL\9.1\bin\pg_restore.exe" -h localhost -U postgres -d Mydata -f "Mydata.backup" pause endlocal The error is:
pg_restore : -d / - dbname and -f / - file can not be used together Try " pg_restore --help "
-fswitch. It is not a switch for specifying input file as you might think.