The below “myusernam” has a password in PostgreSQL.
By using a shell object, I wanted to set PGPASSWORD env variable to avoid password authentication in Windows.
However, it seems that the above ‘set’ command doesn’t work.
I got “psql: FATAL: password authentication failed for user” error. It says that the env variable is not set correctly.
When I run the below command first in Windows prompt and then run “psql.exe” command, it works though.
set PGPASSWORD=mypassword
How can I set the PGPASSWORD env variable in this situation?