pg_dump is ignoring my pgpass file

Lists: pgsql-general
From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dump is ignoring my pgpass file
Date: 2008-10-20 15:40:57
Message-ID: 200810201740.58028.fluca1978@infinito.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi all,
I'm running 8.2.9, and I've got a curious problem on a database of my cluster.
I've got my pgpass file:

backup(at)backup:~$ cat ~/.pgpass
192.168.1.2:5432:raydb:ray:xxxxxxx
192.168.1.2:5432:hrpmdb:hrpm:xxxxx
192.168.1.2:5432:vatcontrollerdb:vatcontroller:xxxxxx

and if I connect from the command line to any database I'm not prompted for a
password. But if I try to execute the following:

pg_dump --create --column-inserts -v -f raydb_ott_20_08.sql -U ray -h
sedeldap raydb

I'm prompted for a password immediatly. But if I execute the same command with
another database (and another user) I'm not prompted for a password at all.
I've checked and the ray user is also owner of the raydb.....any idea on what
I'm missing?

Thanks,
Luca


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Luca Ferrari <fluca1978(at)infinito(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump is ignoring my pgpass file
Date: 2008-10-20 23:11:07
Message-ID: 5998.1224544267@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Luca Ferrari <fluca1978(at)infinito(dot)it> writes:
> I've got my pgpass file:

> backup(at)backup:~$ cat ~/.pgpass
> 192.168.1.2:5432:raydb:ray:xxxxxxx
> 192.168.1.2:5432:hrpmdb:hrpm:xxxxx
> 192.168.1.2:5432:vatcontrollerdb:vatcontroller:xxxxxx

> ... But if I try to execute the following:

> pg_dump --create --column-inserts -v -f raydb_ott_20_08.sql -U ray -h
> sedeldap raydb

AFAICT the matching of .pgpass entries to a connection attempt is
strictly textual. "sedeldap" != "192.168.1.2" therefore none of
these entries apply. The question is not so much why ray isn't
getting let in, as why anyone else is ...

regards, tom lane


From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: pgsql-general(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg_dump is ignoring my pgpass file
Date: 2008-10-22 09:26:18
Message-ID: 200810221126.18785.fluca1978@infinito.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Tuesday 21 October 2008 Tom Lane's cat, walking on the keyboard, wrote:

> AFAICT the matching of .pgpass entries to a connection attempt is
> strictly textual. "sedeldap" != "192.168.1.2" therefore none of
> these entries apply.

Thanks, I'm able to make entries work only with the ip address, and not a
hostname. I guess this is a lookup problem, however with ip addresses it
works.

Luca