It seems some incompatible changes have been made between 7.0 and
current. In 7.0, if a parameter is NULL OR a null string (""), then
the value from an environment variable is applied. However in current
ONLY NULL is considered. Is there any reason for this?
--
Tatsuo Ishii

Tue, 17 Oct 2000 22:34:18 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
incompatible changes of PQsetdbLogin()
Tatsuo Ishii writes:

> It seems some incompatible changes have been made between 7.0 and
> current. In 7.0, if a parameter is NULL OR a null string (""), then
> the value from an environment variable is applied. However in current
> ONLY NULL is considered. Is there any reason for this?

Yes, there are several reasons.  First, to be consistent with
PQconnectdb().  Second, to be able to override a set environment variable
with an empty value.  Third, because the existing behaviour was deemed to
be quite useless.  See Oct 2 thread "libpq PGHOST".  Is there a problem?

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Tue, 17 Oct 2000 17:26:43 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: incompatible changes of PQsetdbLogin()
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> It seems some incompatible changes have been made between 7.0 and
> current. In 7.0, if a parameter is NULL OR a null string (""), then
> the value from an environment variable is applied. However in current
> ONLY NULL is considered. Is there any reason for this?

Peter E. did that recently, after discussion that concluded it was a
good idea --- otherwise there is no way to override an environment
variable with an empty string.  Do you have an example where it's
a bad idea?

			regards, tom lane

Tue, 17 Oct 2000 11:51:26 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: incompatible changes of PQsetdbLogin() 
> Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> > It seems some incompatible changes have been made between 7.0 and
> > current. In 7.0, if a parameter is NULL OR a null string (""), then
> > the value from an environment variable is applied. However in current
> > ONLY NULL is considered. Is there any reason for this?
> 
> Peter E. did that recently, after discussion that concluded it was a
> good idea --- otherwise there is no way to override an environment
> variable with an empty string.  Do you have an example where it's
> a bad idea?

For PGHOST Peter E.'s changes seem reasonable. But what about PGPORT?
In 7.0.x, if pgport is an empty string and PGPORT environment variable
is not set, then the default port no. (5432) is used. However, in
current, if pgport is an empty string, then the empty string is
assumed as a port no. that causes a failure on connection even if
PGPORT variable is set.
--
Tatsuo Ishii

Sun, 22 Oct 2000 18:12:12 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: incompatible changes of PQsetdbLogin() 