diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c index c6862a8..d9e062f 100644 --- a/src/backend/access/transam/timeline.c +++ b/src/backend/access/transam/timeline.c @@ -302,7 +302,8 @@ writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI, /* * Write into a temp file name. */ - snprintf(tmppath, MAXPGPATH, XLOGDIR "/xlogtemp.%d", (int) getpid()); + snprintf(tmppath, MAXPGPATH, XLOGDIR "/" XLOG_TEMP_PREFIX ".%d", + (int) getpid()); unlink(tmppath); @@ -462,7 +463,8 @@ writeTimeLineHistoryFile(TimeLineID tli, char *content, int size) /* * Write into a temp file name. */ - snprintf(tmppath, MAXPGPATH, XLOGDIR "/xlogtemp.%d", (int) getpid()); + snprintf(tmppath, MAXPGPATH, XLOGDIR "/" XLOG_TEMP_PREFIX ".%d", + (int) getpid()); unlink(tmppath); diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 150d56a..e481554 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2928,7 +2928,8 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock) */ elog(DEBUG2, "creating and filling new WAL file"); - snprintf(tmppath, MAXPGPATH, XLOGDIR "/xlogtemp.%d", (int) getpid()); + snprintf(tmppath, MAXPGPATH, XLOGDIR "/" XLOG_TEMP_PREFIX ".%d", + (int) getpid()); unlink(tmppath); @@ -3072,7 +3073,8 @@ XLogFileCopy(char *srcfname, int upto, XLogSegNo segno) /* * Copy into a temp file name. */ - snprintf(tmppath, MAXPGPATH, XLOGDIR "/xlogtemp.%d", (int) getpid()); + snprintf(tmppath, MAXPGPATH, XLOGDIR "/" XLOG_TEMP_PREFIX ".%d", + (int) getpid()); unlink(tmppath); diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index fbf9324..6d8af4e 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -131,6 +131,9 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader; #define XLOGDIR "pg_xlog" #define XLOG_CONTROL_FILE "global/pg_control" +/* Temporary segment of XLog directory */ +#define XLOG_TEMP_PREFIX "xlogtemp" + /* * These macros encapsulate knowledge about the exact layout of XLog file * names, timeline history file names, and archive-status file names.