I am facing an issue even after following all the steps as suggested in the answer provided by Neil Mcguigan for the question asked In the above link
I was getting an error - "psql: f_sendauth no password supplied." When I tried to run a psql command from CMD in Windows server.
I have created pgpass.conf and placed in the path - *C:\users\myname\AppData\Roaming\postgresql*
I have set the environment variable PGPASSFILE and given the above path.
The command I am using looks like this.
psql -w -c "my command to export data from a table in postgre database and save it in a CSV in shared folder" --host myhostname ----dbname mydbname --username my username
-w command in postgre should ideally stop from prompting for a password.
What am I missing..!? Please help
-w
does indeed stop it from prompting for a password. Which is why you get the f_sendauth error, rather than a password prompt.