Re: PITR on Win32 - Archive and Restore

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: PITR on Win32 - Archive and Restore
Дата
Msg-id 200408080142.i781geJ23612@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: PITR on Win32 - Archive and Restore  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: PITR on Win32 - Archive and Restore
Список pgsql-hackers-win32
Andrew Dunstan wrote:
>
> Oh, yes, multiple quotes strings also cause problems :-(. You have no
> idea how frustrating this was when I was writing initdb, and how hard it
> was to find the problems.
>
> The chdir solution might be best if we can do it, so that we only need
> to quote the destination path.
>
> cheers
>
> andrew
>
> markir@coretech.co.nz wrote:
>
> >I tried out Andrew's suggestion, to no avail - none of the archive_commands
> >below work:
> >
> >archive_command = 'copy "%p" "c:/databases/pgarchive/%f"'
> >archive_command = 'copy \"%p\" \"c:/databases/pgarchive/%f\"'
> >archive_command = 'copy \\"%p\\" \\"c:/databases/pgarchive/%f\\"' # desperation
> >...

As I remember the fix was to use this:

    archive_command = '"copy "%p" "c:/databases/pgarchive/%f""'

Yes, that is one extra quote at the start and end of the string.  Would
you try that?

FYI, port.h has this:

    /*
     *  Win32 needs double quotes at the beginning and end of system()
     *  strings.  If not, it gets confused with multiple quoted strings.
     *  It also must use double-quotes around the executable name
     *  and any files used for redirection.  Other args can use single-quotes.
     *
     *  See the "Notes" section about quotes at:
     *      http://home.earthlink.net/~rlively/MANUALS/COMMANDS/C/CMD.HTM
     */
    #ifdef WIN32
    #define SYSTEMQUOTE "\""
    #else
    #define SYSTEMQUOTE ""
    #endif


--
  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 по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: PITR on Win32 - Archive and Restore
Следующее
От: markir@coretech.co.nz
Дата:
Сообщение: Re: PITR on Win32 - Archive and Restore