Re: PITR on Win32 - Archive and Restore

Tom Lane <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>
> 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 [email protected] so that your
      message can get through to the mailing list cleanly
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.