Re: 2 forks for md5?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 2 forks for md5?
Date: 2005-09-22 20:01:49
Message-ID: 43330DAD.3010809@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>
>>Confusion fixed (thanks, Tom). psql (via libpq) tries twice, if not
>>given a password to begin with (via .pgpass or psql's -W).
>>Ugly but at least not incomprehensible.
>>
>>
>
>This seems reasonable behavior when prompting for a password from the
>user, since that's going to take a lot of time anyway. I'm not sure
>whether libpq should try to excavate a password from ~/.pgpass in
>advance of being told by the server that one is needed.
>
>An ideal solution might be to read ~/.pgpass during the bit of code that
>handles a password challenge from the server, rather than in the "outer
>loop". Not having looked at the libpq code recently, I have no idea how
>painful that would be to do.
>
>

Actually, it looks to me like the cause is some code in psql/startup.c
which keeps trying to make a connection while it gets
PQnoPasswordSupplied. libpq seemed to work just fine, picking up pgpass
before a connection was attempted.

My only real concern is that when you turn on log_connections the traces
are confusing - from the user's perspective there is only one
connection, and there are two mentioned in the log, one of which doesn't
have a correspondingly logged disconnect. Maybe worth a mention in the docs?

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2005-09-22 20:08:59 Re: R: feature proposal ...
Previous Message Joshua D. Drake 2005-09-22 19:59:26 Re: Table Partitioning is in 8.1