Archive: postgres password problem


postgres password problem
I see this problem discussed many times but do not see a solution posted in the forum yet.

Many postgreSQL commands such as "psql", "pg_dump" etc. prompt user for the password. Yes it is possible to configure postgres otherwise, but we don't have those options. If you want to run those commands from NSIS script, is there a way to pass the password silently from the script so user is not prompted.

If anybody has a working solution, would appreciate the response.

Thanks.


I tried several options. The only thing that worked for me is to set the environment variable for the installer process and its children.

System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PGPASSWORD", "xxx").r0'