Thread: No password supplied error when using pg_dump
I am trying to run pg_dump to backup my PostgreSQL DB and I am getting a "fe_sendauth: no pssword supplied" error message. This is a Windows Server 2012 environment and I am issuing pg_dump from a command prompt.
The command is as follows:
pg_dump -E win1252 -f d:/respaldos/chartsclub/basedatos/CC.backup -F p -n chartsclub -h localhost -U postgres -w chartsclub
The content of pgpass.conf is:
localhost:5433:chartsclub:postgres:mypassword
Where "mypassword" is the actual valid password which I have successfully tested in pgAdmin3.
After adding this line to pgpass.conf file I restarted PostgreSQL service.
Variable %APPDATA% is:
c:\Users\Administrator\AppData\Roaming
Is there anything else I should take into account?
I will very much appreciate your feedback.
Respectfully,
Jorge Maldonado
On 2016-11-16 20:39, JORGE MALDONADO wrote: > I am trying to run pg_dump to backup my PostgreSQL DB and I am getting a > "fe_sendauth: no pssword supplied" error message. This is a Windows > Server 2012 environment and I am issuing pg_dump from a command prompt. > > The command is as follows: > pg_dump -E win1252 -f d:/respaldos/chartsclub/basedatos/CC.backup -F p > -n chartsclub -h localhost -U postgres -w chartsclub That "-w" makes pg_dump not ask for a password, so you will get an error if the user requires password authentication. -- Stephen
Yes, but it is supposed that "pgpass.conf" is used when "-w" is specified.
I have used this same approach in other server with another DB and it works fine.
On Wed, Nov 16, 2016 at 8:45 PM, Stephen Cook <sclists@gmail.com> wrote:
On 2016-11-16 20:39, JORGE MALDONADO wrote:
> I am trying to run pg_dump to backup my PostgreSQL DB and I am getting a
> "fe_sendauth: no pssword supplied" error message. This is a Windows
> Server 2012 environment and I am issuing pg_dump from a command prompt.
>
> The command is as follows:
> pg_dump -E win1252 -f d:/respaldos/chartsclub/basedatos/CC.backup -F p That "-w" makes pg_dump not ask for a password, so you will get an error
> -n chartsclub -h localhost -U postgres -w chartsclub
if the user requires password authentication.
-- Stephen
JORGE MALDONADO <jorgemal1960@gmail.com> writes: > I am trying to run pg_dump to backup my PostgreSQL DB and I am getting a > "fe_sendauth: no pssword supplied" error message. This is a Windows Server > 2012 environment and I am issuing pg_dump from a command prompt. > The command is as follows: > pg_dump -E win1252 -f d:/respaldos/chartsclub/basedatos/CC.backup -F p -n > chartsclub -h localhost -U postgres -w chartsclub > The content of pgpass.conf is: > localhost:5433:chartsclub:postgres:mypassword Um ... 5433 is not the default port number in a standard build. Unless you've built with that chosen as the compiled-in default, this invocation of pg_dump will be trying to connect to port 5432, and therefore will not use that pgpass entry. regards, tom lane
Great!!!
I hadn´t noticed the port number. I have 2 versions of PostgreSQL running on the same server, that is why I am using port 5433 for the second one.
Thanks.
On Wed, Nov 16, 2016 at 10:31 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
JORGE MALDONADO <jorgemal1960@gmail.com> writes:
> I am trying to run pg_dump to backup my PostgreSQL DB and I am getting a
> "fe_sendauth: no pssword supplied" error message. This is a Windows Server
> 2012 environment and I am issuing pg_dump from a command prompt.
> The command is as follows:
> pg_dump -E win1252 -f d:/respaldos/chartsclub/basedatos/CC.backup -F p -n Um ... 5433 is not the default port number in a standard build.
> chartsclub -h localhost -U postgres -w chartsclub
> The content of pgpass.conf is:
> localhost:5433:chartsclub:postgres:mypassword
Unless you've built with that chosen as the compiled-in default,
this invocation of pg_dump will be trying to connect to port 5432,
and therefore will not use that pgpass entry.
regards, tom lane