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

Re: pg_ctl start broken on windows

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers-win32 <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: pg_ctl start broken on windows
Date: 2004-06-09 16:47:25
Message-ID: 200406091647.i59GlP525217@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers-win32
Andrew Dunstan wrote:
> 
> As I feared might happen, the use of a system() call to start the 
> postmaster in Windows is broken because of the brain dead way its shell 
> handles quotes.  I was able to get around this in initdb by making sure 
> that only one thing on the command line was quoted (by putting PGDATA in 
> the environment instead of the command line). We can't do that here ;-( 
> . Here's what happens:
> 
> C:\msys\1.0\local\pgsql>bin\pg_ctl -D data -l logfile start
> 'C:/msys/1.0/local/pgsql/bin/postmaster.exe"  < nul >>"logfile' is not recognized as an internal or external command, operable program or batch file.
> 
> 
> I think we'll have to bite the bullet and replace that system() call 
> with a direct call to CreateProcess() with the appropriate parameters. I 
> haven't ever done this, so some help from one of the more experienced 
> Windows programmers would be appreciated.

Yes, I assumed pg_ctl would have such issues.  pg_dumpall has them as
well calling pg_dump.

Here is a strange idea that I am looking for someone to check. According
to someone, Win32 system just strips off the first and last quotes, and
that is why it is failing.  Try adding a quote to the beginning and end
of the system string, and leave the existing quote intact.  That might
fix is and if it does I can add this to CVS.

-- 
  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

Responses

pgsql-hackers-win32 by date

Next:From: Andrew DunstanDate: 2004-06-09 16:58:27
Subject: Re: pg_ctl start broken on windows
Previous:From: Greg StarkDate: 2004-06-09 15:39:10
Subject: Re: Tablespaces

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