Re: pg_ctl using START with paths needing quotes - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: pg_ctl using START with paths needing quotes
Date
Msg-id 40C9754E.7010500@dunslane.net
Whole thread Raw
In response to pg_ctl using START with paths needing quotes  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Fix for erroneous warning on Shutdown
Re: pg_ctl using START with paths needing quotes
Re: pg_ctl using START with paths needing quotes
List pgsql-patches
This is a really ugly hack (I take the blame since I gave Bruce the
idea). There are a few things to note:

. the .bat file should probably be created in the data dir - that's
about the only place that we should be guaranteed we can write.
. the command should be preceded by '@' to suppress echoing
. the whole command, including redirections should go inside the .bat
file, so that pg_ctl just issues 'start /b foo.bat'

There are still things to clean up in pg_ctl, e.g. its handling of
relative paths to the data dir.

cheers

andrew



Bruce Momjian wrote:

>This applied patch changes the way pg_ctl starts on Win32.
>
>Using START, it is not possible to quote the executable name, who's
>directory might have spaces:
>
>    START /B /program files/x.exe
>
>The fix is to create a temporary batch file in C:\ containing:
>
>    /program files/x.exe
>
>and run START with the batch name:
>
>    START /B C:\PG_CTL_323223.BAT
>
>then unlink the batch file.
>
>
>

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] [HACKERS] select like...not using index
Next
From: Andreas Pflug
Date:
Subject: Re: Compiling libpq with VisualC