Re: Warning about invalid .pgpass passwords - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Warning about invalid .pgpass passwords
Date
Msg-id 4B99B777.2010508@dunslane.net
Whole thread Raw
In response to Re: Warning about invalid .pgpass passwords  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Warning about invalid .pgpass passwords
List pgsql-hackers

Bruce Momjian wrote:
> +     /* If it was 'invalid authorization', add .pgpass mention */
> +     if (conn->dot_pgpass_used && conn->password_needed && conn->result &&
> +         /* only works with >= 9.0 servers */
> +         strcmp(PQresultErrorField(conn->result, PG_DIAG_SQLSTATE),
> +             ERRCODE_INVALID_PASSWORD_SPECIFICATION) == 0)
> +         appendPQExpBufferStr(&conn->errorMessage,
> +             libpq_gettext("password retrieved from .pgpass\n"));
>   

Surely we should use the name of the actual file from which the password 
was retrieved here, which could be quite different from ".pgpass" (see 
PGPASSFILE environment setting) and is different by default on Windows 
anyway. Using a hardcoded ".pgpass" in those situations could be quite 
confusing.

cheers

andrew


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Warning about invalid .pgpass passwords
Next
From: Merlin Moncure
Date:
Subject: Re: Dyamic updates of NEW with pl/pgsql