...
- After executing the command, you will be prompted for the password which you will be able to type in at the command line.
- pg_dump will look for the environment variable PGPASSWORD. If you store the database password here, pg_dump will use it. This method isn't recommended as it's the least secure.
Store the password in pgpass.conf. The location of this file is C:\Users\<user_name>\AppData\Roaming\postgresql\pgpass.conf. This .conf file should take the following format:
Code Block <host_name>:<port>:<database>:<username>:<password> //for example: localhost:9001:*:postgres:password
This method is considered most secure as you can set permissions on the file.
...