0

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.

enter image description here

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?

Isanka Thalagala
  • 1,321
  • 2
  • 13
  • 28
  • See [here](https://stackoverflow.com/questions/10454173) or [here](https://stackoverflow.com/questions/15359348) or [here](https://stackoverflow.com/questions/6405127/) – a_horse_with_no_name Mar 14 '22 at 10:50

0 Answers0