On Mon, Feb 10, 2014 at 12:14 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
>> Presumably whatever behavior difference you are seeing is somehow
>> related to the use of PQconnectdbParams() rather than PQsetdbLogin(),
>> but the fine manual does not appear to document a different between
>> those functions as regards password-prompting behavior or .pgpass
>> usage.
>
> It looks like PQsetdbLogin() has either NULL or empty string passed to it
> match 5432 in pgpass, while PQconnectdbParams() only has NULL match 5432 and
> empty string does not. pgbench uses empty string if no -p is specified.
>
> This make pgbench behave the way I think is correct, but it hardly seems
> like the right way to fix it.
>
> [ kludge ]
Well, it seems to me that the threshold issue here is whether or not
we should try to change the behavior of libpq. If not, then your
kludge might be the best option. But if so then it isn't necessary.
However, I don't feel confident to pass judgement on the what the
libpq semantics should be.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company