Re: Possible PostgreSQL 8.3beta4 bug with MD5 authentication in psql?

From: Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Possible PostgreSQL 8.3beta4 bug with MD5 authentication in psql?
Date: 2007-12-07 18:29:27
Message-ID: 1197052167.18501.15.camel@mca-desktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-12-07 19:47:22 Re: Release Note Changes
Previous Message Selena Deckelmann 2007-12-07 18:27:01 Re: [HACKERS] Uniform policy for author credits in contrib module documentation?