"Magnus Hagander" <[EMAIL PROTECTED]> writes:
> Tom also wrote:
>> Now that I look at it, there are several places that are depending on
>> getenv("HOME") or getenv("USERPROFILE") (on Windows) as the meaning of
>> "home directory".  In particular ~/.pgpass is sought there, and psql
>> also uses get_home_path in a lot of places.

>> Seems like we should be consistent about this --- either we trust
>> $HOME or we don't.

> Don't trust $HOME on win32. There is no such thing.It's set by Cygwin,
> and it's set by the MingW shell, but it's not set by Windows. HOMEDRIVE,
> HOMEPATH and HOMESHARE are set, but not HOME. 

> You can trust USERPROFILE in NT based OSes. Not sure about 9x. Using the
> API above is a much nicer way of doing it.

We are using $USERPROFILE, not $HOME, on Windows, but I think Magnus is
right: we shouldn't be doing that at all.  If I don't hear any
objections soon, I'm going to replace get_home_path() with code that
uses getpwuid (on Unix) or SHGetSpecialFolderPath (on Windows).

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to