Re: Crash: backup / restore

From: Anssi Kääriäinen <anssi(dot)kaariainen(at)thl(dot)fi>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: "pgadmin-support(at)postgresql(dot)org" <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Crash: backup / restore
Date: 2010-10-21 08:36:20
Message-ID: 4CBFFB84.9080209@thl.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On 10/19/2010 09:14 PM, Guillaume Lelarge wrote:
>> Also, if I remove the host=localhost from pgadmin connection
>> configuration (leaving host blank), I can backup any DB without errors.
>>
>>
> From pgAdmin, I suppose?
>
Yes, from the servers left click a server, pick properties, and remove
all text from Host portion.
>
>> I am using ubuntu 10.04, apt installed postgresql 8.4.5, apt installed
>> pgAdmin, version: 1.10.2 rev 8217.
>>
>>
> pgAdmin cannot give the password to pg_dump without using the
> environment variable (PGPASSWORD)... but it means the password will
> appear in the ps output. That won't happen. The only workaround
> available is to use a .pgpass file. Which pgAdmin would have created if
> you allowed it to store the password.
>
>
The point is there is no postgresql password for the user. A little more
about why the problem happens:

Pgadmin allows me to connect without any password to server when I have
host=localhost in server configuration. If I try to connect from command
line with psql:
psql -h localhost -p 5432 -d xxx -U yyy
I get password prompt. If I do not specify -h and -p I will not get
password prompt, and if I issue
psql -h 127.0.0.1 -p 5432 -d xxx -U yyy
I will not get password prompt. resolveip localhost gives me:
IP address of localhost is 127.0.0.1
IP address of localhost is 127.0.0.1
(yes, two lines)

So when connecting to localhost from pgadmin I do not need password.
When pgadmin issues the dump command, it uses -h localhost -p 5432, and
thus pg_dump requires a password. I can fix this with leaving the host
blank in server configuration. If I have 127.0.0.1 as host, for some
reason, pgadmin requires me to supply a password. This is opposite to
what psql does.

Anyway, the bug is that I can connect without password when
host=localhost, but pgadmin hangs when trying to backup, because
"pg_dump -h localhost ..." requires a password.

- Anssi

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Julius Tuskenis 2010-10-21 09:22:29 no mirrors were found
Previous Message Guillaume Lelarge 2010-10-20 20:14:14 Re: Another Crash