Cannot get a backup using a script - Mailing list pgsql-novice

From JORGE MALDONADO
Subject Cannot get a backup using a script
Date
Msg-id CAAY=A783oXBDaJptWviDtxDU0vfeMU-izY+_FE3k0T_LTj+xPA@mail.gmail.com
Whole thread Raw
Responses Re: Cannot get a backup using a script  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Re: Cannot get a backup using a script  (Ken Benson <Ken@infowerks.com>)
List pgsql-novice
I have been trying to get automated backups of a PostgreSQL database using a script without success. The error I get is "fe_sendauth: no password supplied". 

I have a pgpass.conf in "C:\Users\Username\AppData\Roaming\postgresql\pgpass.conf" with the correct information: localhot:5432:dbname:postgres:mypassword

The script I am testing is as follows:
pg_dump -E win1252 -f d:/respaldos/edocuments/edoc.backup -F p -n edocuments -h localhost -U postgres -w edocuments

I have run such a script with -W instead of -w just to test and I am asked for password and it runs correctly, so the script is fine I suppose.

I also added the following line to the script and I get the same error message:
SET PGPASSFILE="C:\Users\Username\AppData\Roaming\postgresql\pgpass.conf"

My OS is Windows Server 2008 R2.

I will very much appreciate any help.

With respect,
Jorge Maldonado

pgsql-novice by date:

Previous
From: Léa Massiot
Date:
Subject: Re: Cannot start a cluster
Next
From: Albe Laurenz
Date:
Subject: Re: Cannot get a backup using a script