From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Anssi Kääriäinen <anssi(dot)kaariainen(at)thl(dot)fi> |
Cc: | "pgadmin-support(at)postgresql(dot)org" <pgadmin-support(at)postgresql(dot)org> |
Subject: | Re: Crash: backup / restore |
Date: | 2010-10-21 23:06:33 |
Message-ID: | 4CC0C779.5090800@lelarge.info |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
Le 21/10/2010 01:36, Anssi Kääriäinen a écrit :
> 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.
>
The only reason I could guess is that localhost is resolved differently,
once in IPv4 and once in IPv6. And that either your pg_hba.conf accepts
IPv4 and IPv6 connections but with a different authentication methode,
or your .pgpass already has the password for IPv4, and not IPv6 (or
vice-versa). Not sure I explained myself clearly :)
I think you should check your .pgpass file and your pg_hba.conf file.
And be careful about IPv4 and IPv6 resolution.
--
Guillaume
http://www.postgresql.fr
http://dalibo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Guillaume Lelarge | 2010-10-21 23:34:58 | Re: Increasing size of results grid |
Previous Message | Dave Page | 2010-10-21 16:46:11 | Re: Can't use pgAdmin Version 10.12.1 |