diff -r 699924885324 src/bin/pg_rewind/filemap.c --- a/src/bin/pg_rewind/filemap.c Sun Sep 03 11:12:29 2017 -0400 +++ b/src/bin/pg_rewind/filemap.c Mon Sep 04 11:54:28 2017 +0200 @@ -95,6 +95,26 @@ if (strstr(path, "/" PG_TEMP_FILES_DIR "/") != NULL) return; + + /* Also skip configuration files (files ending in .conf) + * + * If these are synchronized, then it is harder to properly set + * up testing environments or cases where the configuration files + * are in the data directory, since rewinding will clobber changes. + */ + if (pg_str_endswith(path, ".conf")) + return; + + /* Finally skip logs. + * + * Clobbering logs causes loss of information as to historical problems + * and should never be done. + * + * We assume that logs end in either "serverlog" or ".log" + */ + if (pg_str_endswith(path, ".log") || pg_str_endswith(path, "serverlog")) + return; + /* * sanity check: a filename that looks like a data file better be a * regular file