I need to restore a PostgreSQL database using a batch file. The batch file will run automatically on the server.
pg_restore --verbose --clean --no-acl --no-owner --host=localhost --dbname=TestDatabase002 --username=postgres "E:\pg_backup\backuyyyp.sql"
This is my command in the batch file and it's working fine except I need to enter the database password manually.
Problem is, I'm going to run this batch file automatically on the server and the password also should enter automatically.
is there a way to execute the restore command including password? or batch file command to enter a password automatically when asking password?