Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. After executing the command, you will be prompted for the password which you will be able to type in at the command line.
  2. 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.
  3. Store the password in pgpass.conf. The location of this file

    is %APPDATA%

    is C:\Users\<user_name>\AppData\Roaming\postgresql\pgpass.conf

    (where %APPDATA% refers to the Application Data subdirectory in the user's profile)

    . 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.

 

Restoring

Make sure you've read Some information you will need and Backing up before proceeding.

...