Re: PITR on Win32 - Archive and Restore

Bruce Momjian <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>
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
> 
> [email protected] 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
  [email protected]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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