Use appendPQExpBufferStr where appropriate

This commit is contained in:
Ian Barwick
2019-08-13 16:31:55 +09:00
parent 5c1ca6cba5
commit 701fdd9622

View File

@@ -3029,18 +3029,18 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
if (*config_file_options.rsync_options == '\0')
{
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
"--archive --checksum --compress --progress --rsh=ssh");
}
else
{
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
config_file_options.rsync_options);
}
if (runtime_options.force)
{
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
" --delete --checksum");
}
@@ -3067,10 +3067,10 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
if (is_directory)
{
/* Files which we don't want */
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
" --exclude=postmaster.pid --exclude=postmaster.opts --exclude=global/pg_control");
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
" --exclude=recovery.conf --exclude=recovery.done");
if (server_version_num >= 90400)
@@ -3079,7 +3079,7 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
* Ideally we'd use PG_AUTOCONF_FILENAME from utils/guc.h, but
* that has too many dependencies for a mere client program.
*/
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
" --exclude=postgresql.auto.conf.tmp");
}
@@ -3091,16 +3091,16 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
if (server_version_num >= 100000)
{
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
" --exclude=pg_wal/*");
}
else
{
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
" --exclude=pg_xlog/*");
}
appendPQExpBuffer(&rsync_flags, "%s",
appendPQExpBufferStr(&rsync_flags,
" --exclude=pg_log/* --exclude=pg_stat_tmp/*");
maxlen_snprintf(script, "rsync %s %s:%s/* %s",