Re: win2k, service, pg_ctl, popen, etc - Mailing list pgsql-hackers-win32

From Bruce Momjian
Subject Re: win2k, service, pg_ctl, popen, etc
Date
Msg-id 200407220246.i6M2kK608414@candle.pha.pa.us
Whole thread Raw
In response to Re: win2k, service, pg_ctl, popen, etc  (Claudio Natoli <claudio.natoli@memetrics.com>)
List pgsql-hackers-win32
Claudio Natoli wrote:
>
>
> > GetModuleFileName() doesn't solve our problem here.  We already know
> > what we think is the right path, but we have to be sure that we are
> > calling a matching version binary.  For example, initdb wants
> > to call a postgres that is the right version, as does pg_ctl.
>
> But do we really care about people who put 7.5 initdb.exe in the same
> directory as, say, 7.6 postgres.exe?
>
>
> > We have had mismatches reported in the past, and with relocatable installs
> it is
> > even more likely.
>
> Exactly my point. The mismatches occur because we *think* we know the right
> path under *nix, and so we grab the version string to make certain. Under
> win32, there would be no such ambiguity, except if people mix versions in
> the same directory; which certainly doesn't appear worth the cost to protect
> against.

Have you looked at find_other_exec().  We call find_my_exec(), then
assuming that works, we go ahead and check versions.  We don't loop back
and keep poking around until we find a matching version.

This code was added particularly so relocable installs don't get wacked
out, and you can bet Win32 will wack it out even more than unix folks.
We need the check.  If we have to put some custom Win32 code in, or use
system() or whatever, we need it.

I am not willing to loosen that check for Win32 --- in fact I would like
that check especially for Win32 where users are less experienced.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-hackers-win32 by date:

Previous
From: Claudio Natoli
Date:
Subject: Re: win2k, service, pg_ctl, popen, etc
Next
From: Claudio Natoli
Date:
Subject: Re: win2k, service, pg_ctl, popen, etc