doc patch - archive/restore_command on windows

Started by ITAGAKI Takahiroabout 18 years ago5 messagespatches
Jump to latest
#1ITAGAKI Takahiro
itagaki.takahiro@oss.ntt.co.jp

I found the examples of documentation about archive_command and
restore_command for Windows are incorrect or improper.

- "copy" doesn't accept / (slash) as a path separator.
We should use \\ (double backslash) for the purpose.
- Windows path is typically starts with a drive letter (C:\\).
- We'd better to quote a whole path, not only the last filename
with double-quotes. It can work, but is not a windows manner.

Index: doc/src/sgml/backup.sgml
===================================================================
--- doc/src/sgml/backup.sgml	(HEAD)
+++ doc/src/sgml/backup.sgml	(working copy)
@@ -1122,7 +1122,7 @@
         when so asked.  Examples:
 <programlisting>
 restore_command = 'cp /mnt/server/archivedir/%f "%p"'
-restore_command = 'copy /mnt/server/archivedir/%f "%p"'  # Windows
+restore_command = 'copy "C:\\server\\archivedir/%f" "%p"'  # Windows
 </programlisting>
        </para>
       </listitem>
Index: doc/src/sgml/config.sgml
===================================================================
--- doc/src/sgml/config.sgml	(HEAD)
+++ doc/src/sgml/config.sgml	(working copy)
@@ -1698,7 +1698,7 @@
         and only if it succeeds.  Examples:
 <programlisting>
 archive_command = 'cp "%p" /mnt/server/archivedir/"%f"'
-archive_command = 'copy "%p" /mnt/server/archivedir/"%f"'  # Windows
+archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"'  # Windows
 </programlisting>
        </para>
       </listitem>

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

#2ITAGAKI Takahiro
itagaki.takahiro@oss.ntt.co.jp
In reply to: ITAGAKI Takahiro (#1)
Re: doc patch - archive/restore_command on windows

Sorry, this is a correct patch.

Index: doc/src/sgml/backup.sgml
===================================================================
--- doc/src/sgml/backup.sgml	(HEAD)
+++ doc/src/sgml/backup.sgml	(working copy)
@@ -1122,7 +1122,7 @@
         when so asked.  Examples:
 <programlisting>
 restore_command = 'cp /mnt/server/archivedir/%f "%p"'
-restore_command = 'copy /mnt/server/archivedir/%f "%p"'  # Windows
+restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
 </programlisting>
        </para>
       </listitem>
Index: doc/src/sgml/config.sgml
===================================================================
--- doc/src/sgml/config.sgml	(HEAD)
+++ doc/src/sgml/config.sgml	(working copy)
@@ -1698,7 +1698,7 @@
         and only if it succeeds.  Examples:
 <programlisting>
 archive_command = 'cp "%p" /mnt/server/archivedir/"%f"'
-archive_command = 'copy "%p" /mnt/server/archivedir/"%f"'  # Windows
+archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"'  # Windows
 </programlisting>
        </para>
       </listitem>

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

#3Andrew Dunstan
andrew@dunslane.net
In reply to: ITAGAKI Takahiro (#1)
Re: doc patch - archive/restore_command on windows

ITAGAKI Takahiro wrote:

I found the examples of documentation about archive_command and
restore_command for Windows are incorrect or improper.

- "copy" doesn't accept / (slash) as a path separator.
We should use \\ (double backslash) for the purpose.
- Windows path is typically starts with a drive letter (C:\\).
- We'd better to quote a whole path, not only the last filename
with double-quotes. It can work, but is not a windows manner.

As previously discussed, we should probably stop recommending use of the
Windows copy command altogether, and recommend use of GnuWin32 cp
instead, for archive_command. The latter does behave sanely w.r.t.
forward slashes.

cheers

andrew

#4Bruce Momjian
bruce@momjian.us
In reply to: ITAGAKI Takahiro (#1)
Re: doc patch - archive/restore_command on windows

Patch applied to CVS HEAD and 8.3.X. Not sure how this was overlooked
in the past. Thanks.

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

ITAGAKI Takahiro wrote:

I found the examples of documentation about archive_command and
restore_command for Windows are incorrect or improper.

- "copy" doesn't accept / (slash) as a path separator.
We should use \\ (double backslash) for the purpose.
- Windows path is typically starts with a drive letter (C:\\).
- We'd better to quote a whole path, not only the last filename
with double-quotes. It can work, but is not a windows manner.

Index: doc/src/sgml/backup.sgml
===================================================================
--- doc/src/sgml/backup.sgml	(HEAD)
+++ doc/src/sgml/backup.sgml	(working copy)
@@ -1122,7 +1122,7 @@
when so asked.  Examples:
<programlisting>
restore_command = 'cp /mnt/server/archivedir/%f "%p"'
-restore_command = 'copy /mnt/server/archivedir/%f "%p"'  # Windows
+restore_command = 'copy "C:\\server\\archivedir/%f" "%p"'  # Windows
</programlisting>
</para>
</listitem>
Index: doc/src/sgml/config.sgml
===================================================================
--- doc/src/sgml/config.sgml	(HEAD)
+++ doc/src/sgml/config.sgml	(working copy)
@@ -1698,7 +1698,7 @@
and only if it succeeds.  Examples:
<programlisting>
archive_command = 'cp "%p" /mnt/server/archivedir/"%f"'
-archive_command = 'copy "%p" /mnt/server/archivedir/"%f"'  # Windows
+archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"'  # Windows
</programlisting>
</para>
</listitem>

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#5Bruce Momjian
bruce@momjian.us
In reply to: ITAGAKI Takahiro (#2)
Re: doc patch - archive/restore_command on windows

This is the patch version I applied. Thanks again.

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

ITAGAKI Takahiro wrote:

Sorry, this is a correct patch.

Index: doc/src/sgml/backup.sgml
===================================================================
--- doc/src/sgml/backup.sgml	(HEAD)
+++ doc/src/sgml/backup.sgml	(working copy)
@@ -1122,7 +1122,7 @@
when so asked.  Examples:
<programlisting>
restore_command = 'cp /mnt/server/archivedir/%f "%p"'
-restore_command = 'copy /mnt/server/archivedir/%f "%p"'  # Windows
+restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
</programlisting>
</para>
</listitem>
Index: doc/src/sgml/config.sgml
===================================================================
--- doc/src/sgml/config.sgml	(HEAD)
+++ doc/src/sgml/config.sgml	(working copy)
@@ -1698,7 +1698,7 @@
and only if it succeeds.  Examples:
<programlisting>
archive_command = 'cp "%p" /mnt/server/archivedir/"%f"'
-archive_command = 'copy "%p" /mnt/server/archivedir/"%f"'  # Windows
+archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"'  # Windows
</programlisting>
</para>
</listitem>

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +