Tom Lane wrote:
> Hm. I'm of the opinion that the real problem here is the code's
> assumption that it is reasonable to force dbname = servicename when
> the service file doesn't say any such thing. For all other
> parameters, omitting the parameter from pg_service.conf causes the
> standard default to be adopted. Why should dbname work differently?
Regardless of this particular issue, I think it would be useful if,
under some conditions to be identified, some service were taken as
default if nothing is specied in libpq. That would eliminate the need
to set environment variables, which is undesirable in many situations.