Re: Possible PostgreSQL 8.3beta4 bug with MD5 authentication in psql? - Mailing list pgsql-hackers

From Mark Cave-Ayland
Subject Re: Possible PostgreSQL 8.3beta4 bug with MD5 authentication in psql?
Date
Msg-id 1197052167.18501.15.camel@mca-desktop
Whole thread Raw
In response to Re: Possible PostgreSQL 8.3beta4 bug with MD5 authentication in psql?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Possible PostgreSQL 8.3beta4 bug with MD5 authentication in psql?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 2007-12-07 at 11:03 -0500, Tom Lane wrote:

> Hmmm ... it seems the problem is that we've defined
> PQconnectionUsedPassword in such a way that it returns true (causing a
> prompt) regardless of whether the reason for the connection failure was
> a bad password or not.  We might need to reconsider that API.

Right. I think it depends on the interpretation of the
PQconnectionUsedPassword function. If it should simply return whether or
not the connection used a password or not (as it does now), then you
could argue that it should be psql which should incorporate an
additional check to determine whether the attempt was cancelled due to
an invalid database name.

On first glance, libpq appears to return just CONNECTION_BAD and an
error message, so I'm not sure whether we can easily detect the
difference between an incorrect password and an invalid database name :(
Is there an additional status code in PGconn that can be used to
determine the exact cause of connection failure?


ATB,

Mark.

-- 
ILande - Open Source Consultancy
http://www.ilande.co.uk




pgsql-hackers by date:

Previous
From: "Selena Deckelmann"
Date:
Subject: Re: [DOCS] Uniform policy for author credits in contrib module documentation?
Next
From: Bruce Momjian
Date:
Subject: Re: Release Note Changes