Skip site navigation (1) Skip section navigation (2)

Re: win2k, service, pg_ctl, popen, etc

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>
Cc: "'Magnus Hagander'" <mha(at)sollentuna(dot)net>,pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: win2k, service, pg_ctl, popen, etc
Date: 2004-07-22 02:46:20
Message-ID: 200407220246.i6M2kK608414@candle.pha.pa.us (view raw or flat)
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers-win32 by date

Next:From: Claudio NatoliDate: 2004-07-22 03:15:07
Subject: Re: win2k, service, pg_ctl, popen, etc
Previous:From: Claudio NatoliDate: 2004-07-22 00:44:32
Subject: Re: win2k, service, pg_ctl, popen, etc

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group