I have a bat that creates the backup of a BD in PostgreSQL. This is the batch code:
@echo off
SET PG_BIN="C:\Program Files\PostgreSQL\bin\pg_dump.exe"
SET PG_HOST=localhost
SET PG_PORT=5432
SET PG_DATABASE=CELAUSystem
SET PG_USER=postgres
SET PG_PASSWORD=7777
SET PG_PATH=C:\Program Files\CELAUSystem
SET PG_FECHA=%date:~11,4%%date:~8,2%%date:~5,2%
SET PG_FILENAME="%PG_PATH%\%PG_DATABASE%_%PG_FECHA%.dump"
%PG_BIN% -U %PG_USER% -v -F c %PG_DATABASE% > %PG_FILENAME%
the result is this:
"C: \ Program Files \ PostgreSQL \ 10 \ bin \ pg_dump.exe" -U postgres -v -F c CELAUSystem > C: \ Program Files \ CELAUSystem \ CELAUSystem_20180710.dump
It works fine but when the bat is executed it asks me to type the password of the BD user and does not create the backup until I type it, how can I do it to be automatically typed? Thanks in advance.