Wednesday, March 20, 2013

Enable pgpass under Windows XP

These are the steps I used to enable pgpass under Windows XP.
  1. Create file with name: pgpass.conf with this information in it: hostname:port:database:username:password

    see this for file data format

  2. Move the file to the %APP_DATA%\postgresql directory of the user running the backup ( not the db server user - postgres). In my case it was: C:\Documents and Settings\Windows User Name\Application Data\postgresql.
  3. Add --no-password option to the backup statement like this: "C:\Program Files\PostgreSQL\9.X\bin\pg_dump.exe" -h localhost -U postgres --no-password -C -f "database_name_dump.sql" database_name_db
Done.

No comments:

Post a Comment