On 13-03-20 05:54 PM, Tom Lane wrote:
> Steve Singer <ssinger@ca.afilias.info> writes:
>
>> From a end-user expectations point of view I am okay with somehow
>> marking the structure returned by PQconndefaults in a way that the
>> connect calls will later fail.
>
> Unless the program changes the value of PGSERVICE, surely all subsequent
> connection attempts will fail for the same reason, regardless of what
> PQconndefaults returns?
>
> regards, tom lane
>
>
So your proposing we do something like the attached patch? Where we
change conninfo_add_defaults to ignore an invalid PGSERVICE if being
called by PQconndefaults() but keep the existing behaviour in other
contexts where it is actually being used to establish a connection?
In this case even if someone takes the result of PQconndefaults and uses
that to build connection options for a new connection it should fail
when it does the pgservice lookup when establishing the connection.
That sounds reasonable to me.
Steve