Re: PITR on Win32 - Archive and Restore

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: PITR on Win32 - Archive and Restore
Дата
Msg-id 200408101803.i7AI3Wa19241@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: PITR on Win32 - Archive and Restore  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers-win32
I have gotten confused by this.  Does COPY work with quoted paths only
if we use forward slashes, or was this fix just for the slash issue and
not spaces?

---------------------------------------------------------------------------

Tom Lane wrote:
> > Okay, I'll change %p to emit \ on Windows, and we'll see where that
> > takes us.
>
> I've applied the attached patch, in case anyone is in a big hurry to try
> it.
>
>             regards, tom lane
>
>
> Index: src/backend/access/transam/xlog.c
> ===================================================================
> RCS file: /cvsroot/pgsql-server/src/backend/access/transam/xlog.c,v
> retrieving revision 1.157
> diff -c -r1.157 xlog.c
> *** src/backend/access/transam/xlog.c    8 Aug 2004 03:22:08 -0000    1.157
> --- src/backend/access/transam/xlog.c    9 Aug 2004 16:23:51 -0000
> ***************
> *** 1962,1968 ****
> --- 1962,1978 ----
>                       /* %p: full path of target file */
>                       sp++;
>                       StrNCpy(dp, xlogpath, endp-dp);
> + #ifndef WIN32
>                       dp += strlen(dp);
> + #else
> +                     /* On Windows, change / to \ in the substituted path */
> +                     while (*dp)
> +                     {
> +                         if (*dp == '/')
> +                             *dp = '\\';
> +                         dp++;
> +                     }
> + #endif
>                       break;
>                   case 'f':
>                       /* %f: filename of desired file */
> Index: src/backend/postmaster/pgarch.c
> ===================================================================
> RCS file: /cvsroot/pgsql-server/src/backend/postmaster/pgarch.c,v
> retrieving revision 1.5
> diff -c -r1.5 pgarch.c
> *** src/backend/postmaster/pgarch.c    5 Aug 2004 23:32:10 -0000    1.5
> --- src/backend/postmaster/pgarch.c    9 Aug 2004 16:23:51 -0000
> ***************
> *** 436,442 ****
> --- 436,452 ----
>                       /* %p: full path of source file */
>                       sp++;
>                       StrNCpy(dp, pathname, endp-dp);
> + #ifndef WIN32
>                       dp += strlen(dp);
> + #else
> +                     /* On Windows, change / to \ in the substituted path */
> +                     while (*dp)
> +                     {
> +                         if (*dp == '/')
> +                             *dp = '\\';
> +                         dp++;
> +                     }
> + #endif
>                       break;
>                   case 'f':
>                       /* %f: filename of source file */
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>

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

Предыдущее
От: "Rodrigo Moreno"
Дата:
Сообщение: InitDB Failure on install
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PITR on Win32 - Archive and Restore