diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-08-12 19:03:44 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-08-12 19:03:44 +0000 |
commit | 10249abfa19a53e9e158396333400ae66ae1c02b (patch) | |
tree | 80887a83530e2fc6244c0ac9396c01f6f9a82b47 /src | |
parent | 43ea65a0dcc1de11e7de841cdf6bc57348ac17b1 (diff) | |
download | postgresql-10249abfa19a53e9e158396333400ae66ae1c02b.tar.gz postgresql-10249abfa19a53e9e158396333400ae66ae1c02b.zip |
Cleanup Win32 COPY handling, and move archive examples to SGML.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xlog.c | 14 | ||||
-rw-r--r-- | src/backend/postmaster/pgarch.c | 13 | ||||
-rw-r--r-- | src/backend/utils/misc/postgresql.conf.sample | 10 | ||||
-rw-r--r-- | src/port/path.c | 15 |
4 files changed, 15 insertions, 37 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 50ba2156e08..b9d0398b621 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.161 2004/08/12 18:34:45 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.162 2004/08/12 19:03:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1962,18 +1962,6 @@ RestoreArchivedFile(char *path, const char *xlogfname, /* %p: full path of target file */ sp++; StrNCpy(dp, xlogpath, endp-dp); - /* - * make_native_path() is required because WIN32 COPY is - * an internal CMD.EXE command and doesn't process - * forward slashes in the same way as external commands. - * Quoting the first argument to COPY does not convert - * forward to backward slashes, but COPY does properly - * process quoted forward slashes in the second argument. - * - * COPY works with quoted forward slashes in the first argument - * only if the current directory is the same as the directory - * of the first argument. - */ make_native_path(dp); dp += strlen(dp); break; diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 83587551c9b..d11bf17a2b4 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -19,7 +19,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.6 2004/08/09 16:26:06 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.7 2004/08/12 19:03:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -436,17 +436,8 @@ pgarch_archiveXlog(char *xlog) /* %p: full path of source file */ sp++; StrNCpy(dp, pathname, endp-dp); -#ifndef WIN32 + make_native_path(dp); 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 */ diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 28463c6ae9b..cdd427f04b6 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -117,16 +117,6 @@ # - Archiving - #archive_command = '' # command to use to archive a logfile segment -# -# If archive_command is '' then archiving is disabled. Otherwise, set it -# to a command to copy a file to the proper place. Any %p in the string -# is replaced by the absolute path of the file to archive, while any %f is -# replaced by the file name only. NOTE: it is important for the command to -# return zero exit status only if it succeeds. -# -# Examples: -# archive_command = 'cp "%p" /mnt/server/archivedir/"%f"' -# archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Win32 #--------------------------------------------------------------------------- diff --git a/src/port/path.c b/src/port/path.c index 2a7428d0ba6..50f6476f427 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/port/path.c,v 1.28 2004/08/12 18:32:52 momjian Exp $ + * $PostgreSQL: pgsql/src/port/path.c,v 1.29 2004/08/12 19:03:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -88,8 +88,17 @@ last_dir_separator(const char *filename) /* - * make_native_path - * On WIN32, change / to \ in the path. + * make_native_path - on WIN32, change / to \ in the path + * + * This is required because WIN32 COPY is an internal CMD.EXE + * command and doesn't process forward slashes in the same way + * as external commands. Quoting the first argument to COPY + * does not convert forward to backward slashes, but COPY does + * properly process quoted forward slashes in the second argument. + * + * COPY works with quoted forward slashes in the first argument + * only if the current directory is the same as the directory + * of the first argument. */ void make_native_path(char *filename) |